TheAlgorithms / C-Plus-Plus

Collection of various algorithms in mathematics, machine learning, computer science and physics implemented in C++ for educational purposes.
https://thealgorithms.github.io/C-Plus-Plus
MIT License
30.58k stars 7.24k forks source link

Algorithm to Check if the graph is Bipartite(bicolourable) #2788

Closed THIRU-1074 closed 2 weeks ago

THIRU-1074 commented 2 weeks ago

Detailed description

Bipartite graph has various application in modern coding theory.The implementation of algorithm to check if the graph is Bipartite is crucial.

https://en.m.wikipedia.org/wiki/Bipartite_graph

Context

This feature is a base for many other application oriented algorithms to be implementation.

Possible implementation

The graph is categorized to be bipartite if it doesn't contain odd nodes cycle. So by looking for odd node cycle the graph could be categorized to Bipartite or not.

Additional information

No response

ritk20 commented 2 weeks ago

It's already present, right? is_graph_bipartite.cpp

realstealthninja commented 2 weeks ago

It's already present, right? is_graph_bipartite.cpp

nice catch, will close this as resolved!