File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ public function getColors()
65
65
$ nextColor = 1 -$ color ;
66
66
67
67
// scan all vertices connected to this vertex
68
- foreach ($ vertex ->getVerticesEdge () as $ vid => $ nextVertex ) {
68
+ foreach ($ vertex ->getVerticesEdge ()-> getMap () as $ vid => $ nextVertex ) {
69
69
// color unknown, so expect next color for this vertex
70
70
if (!isset ($ colors [$ vid ])) {
71
71
$ colors [$ vid ] = $ nextColor ;
Original file line number Diff line number Diff line change @@ -27,9 +27,8 @@ public function getVertices()
27
27
$ visited [$ t ->getId ()]= $ t ;
28
28
29
29
// get next vertices
30
- $ vertices = $ this ->getVerticesAdjacent ($ t );
31
- foreach ($ vertices as $ id => $ vertex ) {
32
- // if not "toughed" before
30
+ foreach ($ this ->getVerticesAdjacent ($ t )->getMap () as $ id => $ vertex ) {
31
+ // if not "touched" before
33
32
if (!isset ($ mark [$ id ])) {
34
33
// add to queue
35
34
$ queue [] = $ vertex ;
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ private function iterativeDepthFirstSearch(Vertex $vertex)
40
40
if (!isset ($ visited [$ vertex ->getId ()])) {
41
41
$ visited [$ vertex ->getId ()] = $ vertex ;
42
42
43
- foreach (array_reverse ($ this ->getVerticesAdjacent ($ vertex ), true ) as $ vid => $ nextVertex ) {
43
+ foreach (array_reverse ($ this ->getVerticesAdjacent ($ vertex )-> getMap () , true ) as $ vid => $ nextVertex ) {
44
44
$ todo [] = $ nextVertex ;
45
45
}
46
46
}
You can’t perform that action at this time.
0 commit comments