mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
KCC: improved documentation for verify_graph_directed_double_ring
The actual function is still somewhat broken. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
a2d3b3117c
commit
d383cd6f5e
@ -2503,19 +2503,20 @@ def verify_graph_no_unknown_vertices(edges, vertices, edge_vertices):
|
||||
|
||||
|
||||
def verify_graph_directed_double_ring(edges, vertices, edge_vertices):
|
||||
"""Each node has two directed edges leaving it, and two arriving. The
|
||||
edges work in pairs that have the same end points but point in
|
||||
opposite directions. The pairs form a path that touches every
|
||||
vertex and form a loop.
|
||||
"""Each node has at least two directed edges leaving it, and two
|
||||
arriving. The edges work in pairs that have the same end points
|
||||
but point in opposite directions. The pairs form a path that
|
||||
touches every vertex and form a loop.
|
||||
|
||||
There might be other connections that *aren't* part of the ring.
|
||||
"""
|
||||
#XXX possibly the 1 and 2 vertex cases are special cases.
|
||||
if not edges:
|
||||
return
|
||||
if len(edges) != 2* len(vertices):
|
||||
raise KCCGraphError("directed double ring requires edges == 2 * vertices")
|
||||
if len(edges) < 2* len(vertices):
|
||||
raise KCCGraphError("directed double ring requires at least twice as many edges as vertices")
|
||||
|
||||
exits = {}
|
||||
|
||||
for start, end in edges:
|
||||
s = exits.setdefault(start, [])
|
||||
s.append(end)
|
||||
|
Loading…
Reference in New Issue
Block a user