How do I generate list of connected graphs with given number of vertices?
asked 2015-08-25 00:07:30 -0600
This post is a wiki. Anyone with karma >750 is welcome to improve it.
I have used this short nauty program to generate graphs with given number of vertices, edges and degree information. c =0 for G in graphs . nauty_geng (’9 12 -d4D4 ’) : c = c +1 print " graph "+str( c ) +" ( graph6 string ’"+ G . graph6_string () +" ’):" G . adjacency_matrix () G . show () print "" print ""
It generates a list of all graph with given information. My query is that How do I filter them to get only connected ones?