-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create isBipartiteGraph.hpp #465
base: master
Are you sure you want to change the base?
Conversation
Also, can you add a couple of tests please? |
->Test for Bipartite Graph ->Test for Non-Bipartite Graph ->Test for Empty Graph ->Test for Single Node Graph ->Test for Complex Bipartite Graph
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing, please clang-format both files. Thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are failing. You need to include this file in CXXGraph/include/Graph/Graph.h
|
||
CXXGraph::Graph<int> graph(edgeSet); | ||
|
||
bool isBipartite = graph.isBipartite(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method doesn't exist, you didn't define it. Maybe you'd want to rename the methods in the header file.
class Graph { | ||
public: | ||
TopoSortResult<T> checkOddNodesCycleDir() const; | ||
|
||
private: | ||
void checkOddNodesCycleUtil(std::vector<int>& visited, | ||
std::vector<int>& chainNo, int root, | ||
int cycleLength, bool& isBiPartite) const; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't re-declare the class here. Declare the methods in the Graph_decl.hpp file, possibly adding method descriptions like you see there, and in this file you only define them
Also, check that the code compiles and runs before committing :) |
->ISSUE REFERENCE:
#464 (comment)
->DESCRIPTION:
Implemented a header file to check if the graph is biPartite or biColourable. The algorithm has its own cycle detection algorithm which counts the number of nodes in the cycle and checks for odd nodes cycle, which determines whether the undirected graph is biPartite.
->REVIEW MEMBER
@ZigRazor