8383# Method for Dinic's algorithm
8484
8585@traitfn function maximum_flow (
86- flow_graph: :: :lg . IsDirected, # the input graph
87- source:: Integer , # the source vertex
88- target:: Integer , # the target vertex
89- capacity_matrix:: AbstractMatrix , # edge flow capacities
90- algorithm :: DinicAlgorithm # keyword argument for algorithm
86+ flow_graph: :: :lg . IsDirected, # the input graph
87+ source:: Integer , # the source vertex
88+ target:: Integer , # the target vertex
89+ capacity_matrix:: AbstractMatrix , # edge flow capacities
90+ algorithm :: DinicAlgorithm # keyword argument for algorithm
9191 )
9292 residual_graph = residual (flow_graph)
9393 return dinic_impl (residual_graph, source, target, capacity_matrix)
@@ -109,11 +109,11 @@ end
109109# Method for Push-relabel algorithm
110110
111111@traitfn function maximum_flow (
112- flow_graph: :: :lg . IsDirected, # the input graph
113- source:: Integer , # the source vertex
114- target:: Integer , # the target vertex
115- capacity_matrix:: AbstractMatrix , # edge flow capacities
116- algorithm:: PushRelabelAlgorithm # keyword argument for algorithm
112+ flow_graph: :: :lg . IsDirected, # the input graph
113+ source:: Integer , # the source vertex
114+ target:: Integer , # the target vertex
115+ capacity_matrix:: AbstractMatrix , # edge flow capacities
116+ algorithm:: PushRelabelAlgorithm # keyword argument for algorithm
117117 )
118118 residual_graph = residual (flow_graph)
119119 return push_relabel (residual_graph, source, target, capacity_matrix)
@@ -164,14 +164,14 @@ julia> f, F, labels = maximum_flow(flow_graph, 1, 8, capacity_matrix, algorithm=
164164```
165165"""
166166function maximum_flow (
167- flow_graph:: lg.AbstractGraph , # the input graph
168- source:: Integer , # the source vertex
169- target:: Integer , # the target vertex
170- capacity_matrix:: AbstractMatrix = # edge flow capacities
171- DefaultCapacity (flow_graph);
172- algorithm:: AbstractFlowAlgorithm = # keyword argument for algorithm
173- PushRelabelAlgorithm (),
174- restriction:: Real = 0 # keyword argument for restriction max-flow
167+ flow_graph:: lg.AbstractGraph , # the input graph
168+ source:: Integer , # the source vertex
169+ target:: Integer , # the target vertex
170+ capacity_matrix:: AbstractMatrix = # edge flow capacities
171+ DefaultCapacity (flow_graph);
172+ algorithm:: AbstractFlowAlgorithm = # keyword argument for algorithm
173+ PushRelabelAlgorithm (),
174+ restriction:: Real = 0 # keyword argument for restriction max-flow
175175 )
176176 if restriction > 0
177177 return maximum_flow (flow_graph, source, target, min .(restriction, capacity_matrix), algorithm)
0 commit comments