mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-11 00:59:49 +00:00
networking_flow
This commit is contained in:
parent
2f53847247
commit
e3a03c559e
@ -21,7 +21,7 @@ def BFS(graph, s, t, parent):
|
|||||||
parent[ind] = u
|
parent[ind] = u
|
||||||
|
|
||||||
return True if visited[t] else False
|
return True if visited[t] else False
|
||||||
|
|
||||||
def FordFulkerson(graph, source, sink):
|
def FordFulkerson(graph, source, sink):
|
||||||
# This array is filled by BFS and to store path
|
# This array is filled by BFS and to store path
|
||||||
parent = [-1]*(len(graph))
|
parent = [-1]*(len(graph))
|
||||||
|
@ -16,7 +16,7 @@ def BFS(graph, s, t, parent):
|
|||||||
parent[ind] = u
|
parent[ind] = u
|
||||||
|
|
||||||
return True if visited[t] else False
|
return True if visited[t] else False
|
||||||
|
|
||||||
def mincut(graph, source, sink):
|
def mincut(graph, source, sink):
|
||||||
# This array is filled by BFS and to store path
|
# This array is filled by BFS and to store path
|
||||||
parent = [-1]*(len(graph))
|
parent = [-1]*(len(graph))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user