Added a subroutine to check whether a graph is symmetric and a test to make sure it works properly