-
-
Notifications
You must be signed in to change notification settings - Fork 206
is_bipartite() is confusing / problematic #709
Description
Before you read further, please guess what you think the is_bipartite() function does, if you are not already familiar with it.
No, it's not the same as igraph_is_bipartite() in C, .is_bipartite() in Python or IGBipartiteQ[] in Mathematica. Those functions decide if the graph is bipartite (i.e. 2-colourable) in the graph theoretical sense.
is_bipartite() in R simply checks whether a graph has a type vertex attribute. This is documented, but in a way that is somewhat confusing, and easy to miss. It's at the bottom of the doc page:
is_bipartite() checks whether the graph is bipartite or not. It just checks whether the graph has a vertex attribute called type.
In plain words, the term "bipartite" in R/igraph is used differently than just about anywhere else. We should consider changing this terminology in igraph 2.0, so it lines up better with common usage.
2-colourability is checked by bipartite_mapping().