MathOverflow is a question and answer site for professional mathematicians. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am studying graph algorithms.

I need database of graphs on which I can test my algorithms.

Where can I find reliable database of graphs of all kinds?


share|cite|improve this question
You might want to be more specific. Do you want all graphs on $n$ vertices or less? Do you want pathological examples? How do you want your graphs presented to you? Graphically? An edge list? As an input to a specific piece of software. SAGE has large classes of graphs built-in. – Cam McLeman May 6 '10 at 17:42
One option is to generate random graphs -- the usefulness of this would depend on the specific application in mind. – Douglas S. Stones May 7 '10 at 1:41
up vote 11 down vote accepted

You might want to look at Donald Knuth's Stanford GraphBase: A Platform for Combinatorial Computing (1994, 2009) and the accompanying website.

See also The Stony Brook Algorithm Repository.

share|cite|improve this answer

There's a nice collection of data on regular graphs at Markus Meringer's webpage.

share|cite|improve this answer

Sage ( provides access to a large collection of graphs, as well as tools for working with them.

share|cite|improve this answer

nauty comes with some additional programs. In particular, you might be interested in geng. As the website says "geng can generate non-isomorphic graphs very quickly. There are also generators for bipartite graphs, digraphs, and multigraphs."

share|cite|improve this answer

Maple 13 or newer has a GraphTheory package that has a graph generator which allows you to generate all non-isomorphic graphs satisfying various criteria. You can use that to produce graphs and export them in various formats. In addition, you can produce random graphs using this package.

share|cite|improve this answer

Here's a collection of 3054 "standard named graphs" from Mathematica's GraphData collection

It's one graph per line, description followed by pairs of adjacent vertices

share|cite|improve this answer

Two such websites I am aware of are:

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.