protected function addEdgesSorted(Edges $edges, SplPriorityQueue $sortedEdges)
    {
        // For all edges
        foreach ($edges as $edge) {
            /* @var $edge Edge */
            // ignore loops (a->a)
            if (!$edge->isLoop()) {
                // Add edges with negative weight because of order in stl
                $sortedEdges->insert($edge, -$edge->getWeight());
            }
        }
    }