Commit 21c38be9 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Return trivial partition in is_bipartite() if graph is not bipartite

parent 0c9b33c0
......@@ -1466,6 +1466,9 @@ def is_bipartite(g, partition=False):
g = GraphView(g, directed=False)
is_bi = libgraph_tool_topology.is_bipartite(g._Graph__graph,
_prop("v", g, part))
if not is_bi and part is not None:
part.a = 0
if partition:
return is_bi, part
else:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment