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 flow graphs
11
+ *
12
+ * A flow network (also known as a transportation network) is a directed graph
13
+ * where each edge has a capacity and each edge receives a flow.
14
+ *
15
+ * @link http://en.wikipedia.org/wiki/Flow_network
16
+ * @see Algorithm\Balance
17
+ */
18
+ class Flow extends BaseSet
19
+ {
20
+ /**
21
+ * check if this graph has any flow set (any edge has a non-NULL flow)
22
+ *
23
+ * @return boolean
24
+ * @uses Edge::getFlow()
25
+ */
26
+ public function hasFlow ()
27
+ {
28
+ foreach ($ this ->set ->getEdges () as $ edge ) {
29
+ if ($ edge ->getFlow () !== NULL ) {
30
+ return true ;
31
+ }
32
+ }
33
+
34
+ return false ;
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments