Ok, the assignment I am working on now has to do with graphs.
Write a function void isNotIsomorphic which answers "yes" when two graphs are not isomorphic because their degree sequences are different and answers "I don't know" if their degree sequences match.
Here is the code that we were given to start with:
#include
#include
using namespace std;
class Isomorphism {
public:
static void isNotIsomorphic(bool** g1, bool** g2, int nbrVertices)
{
//IMPLEMENT THIS FUNCTION
}
private:
//IMPLEMENT ANY HELPER FUNCTIONS HERE
};
We have to find the degree sequences of both graphs, and if they are the same, it'll print "I don't know", if they are different, "No." This means that we would have to sort the degrees.
What I'm not sure about is how to write a code that would calculate the degree sequence and then sort it. I assume I'll need a helper function to sort it. We can use quick, merge or heap sort. Any help would be appreciated!
