Open cjoshea9 opened 7 years ago
Need docstring (what are the input parameters???)
@rbarden @cjoshea9
Can you explain what this function is meant to do?
I'd like to add a docstring about it.
Also, when I run max_bipartite_set(k6, [0,1,2], [3,4])
, I get back [0,1,2]
, which I don't think is a bipartite subgraph...
It looks like this is an auxilliary function for computing the bipartite number of a graph: that is, the size of a maximum set of vertices that induces a bipartite subgraph.
This number comes up, for instance, in investigations of the independence number of a graph (alpha >= 0.5*bipartite number).
The function above looks like maybe it is trying to use the idea of the Tarjan-Trojanowski maximum independent set algorithm to find a maximum bipartite subgraph. The basic idea here would be: either a vertex v is in a maximum bipartite subgraph or it is not.
In an case, a properly written function should return a 2-element set if the input is a complete graph (with order at least 2) and bipartite_number(Kn)=2.