File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Fhaculty \Graph \Algorithm ;
4
+
5
+ use Fhaculty \Graph \Algorithm \BaseGraph ;
6
+ use Fhaculty \Graph \Edge \Base as Edge ;
7
+ use Fhaculty \Graph \Graph ;
8
+
9
+ /**
10
+ * Basic algorithms for working with parallel edges
11
+ *
12
+ * Parallel edges (also called multiple edges or a multi-edge), are two or more
13
+ * edges that are incident to the same two vertices. A simple graph has no
14
+ * multiple edges.
15
+ *
16
+ * @link http://en.wikipedia.org/wiki/Multiple_edges
17
+ */
18
+ class Parallel extends BaseGraph
19
+ {
20
+ /**
21
+ * checks whether this graph has any parallel edges (aka multigraph)
22
+ *
23
+ * @return boolean
24
+ * @uses Edge::hasEdgeParallel() for every edge
25
+ */
26
+ public function hasEdgeParallel ()
27
+ {
28
+ foreach ($ this ->graph ->getEdges () as $ edge ) {
29
+ if ($ edge ->hasEdgeParallel ()) {
30
+ return true ;
31
+ }
32
+ }
33
+
34
+ return false ;
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments