Bipartite Graphs
A challenge by
mousetail
Description
According to Wikipedia a bipartite graph is the following:
In the mathematical field of graph theory, a bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint and independent sets
UandV, that is, every edge connects a vertex inUto one inV. Vertex setsUandVare usually called the parts of the graph. Equivalently, a bipartite graph is a graph that does not contain any odd-length cycles.
Your task is, given a list of graphs, output only the graphs that are bipartite.
Input Format
The input format will be: One graph per line, a space separated list of node indexes that the nth node connects to. For example
1, 0,2 1
Means node 0 has an edge to 1, 1 had edges to 0 and finally node 2 has one edge to node 1.
This challenge is a sub task of the Graph Planarity challenge
Leaderboard
| Author | Points | ||
|---|---|---|---|
| #1 |
|
Mukundan314 | 100 |
| #1 |
|
bizy-coder | 100 |
| #3 |
|
ovs-code | 103 |
| #4 |
|
NicknamedTwice | 222 |
| #5 |
|
mousetail | 557 |