File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,24 @@ public function getVerticesId()
120
120
return array_keys ($ this ->getDistanceMap ());
121
121
}
122
122
123
+ /**
124
+ * checks whether there's a path from this start vertex to given end vertex
125
+ *
126
+ * @param Vertex $endVertex
127
+ * @return boolean
128
+ * @uses self::getEdgesTo()
129
+ */
130
+ public function hasVertex (Vertex $ vertex )
131
+ {
132
+ try {
133
+ $ this ->getEdgesTo ($ vertex );
134
+ }
135
+ catch (OutOfBoundsException $ e ) {
136
+ return false ;
137
+ }
138
+ return true ;
139
+ }
140
+
123
141
/**
124
142
* get map of vertex IDs to distance
125
143
*
Original file line number Diff line number Diff line change @@ -90,24 +90,6 @@ public function getDistanceMap()
90
90
return $ ret ;
91
91
}
92
92
93
- /**
94
- * checks whether there's a path from this start vertex to given end vertex
95
- *
96
- * @param Vertex $endVertex
97
- * @return boolean
98
- * @uses self::getEdgesTo()
99
- */
100
- public function hasVertex (Vertex $ vertex )
101
- {
102
- try {
103
- $ this ->getEdgesTo ($ vertex );
104
- }
105
- catch (OutOfBoundsException $ e ) {
106
- return false ;
107
- }
108
- return true ;
109
- }
110
-
111
93
/**
112
94
* get array of all target vertices this vertex has a path to
113
95
*
You can’t perform that action at this time.
0 commit comments