# The algorithm of ListGraphs[n,m]

I'm not sure if this is a Mathematica problem, math problem or a CS problem, so if this is off-topic please transfer it.

In the package Combinatorica there is a function ListGraphs[n,m] which returns all nonisomorphic undirected graphs with n vertices and m edges. What algorithm does it use? All I can think of is to enumerate all graphs with n vertices and m edges brute-force, and check isomorphism for each graph. But I don't think that's effective. Is there a better algorism for this task? Thanks!

-
The Combinatorica package is described in detail in this book: Computational Discrete Mathematics: Combinatorics and Graph Theory with Mathematica . –  Yves Klett Jun 23 '14 at 7:00
@YvesKlett Thanks for the recommendation! I checked but it's not in our library, so I might as well wait for an answer –  Alex Su Jun 23 '14 at 7:08

You can find the code for the function in the file Combinatorica.m:
nb = NotebookOpen[ToFileName[{\$InstallationDirectory, "AddOns", "Packages",