Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sample input for various algorithms

Tags:

algorithm

I have been reading parts of Introduction to Algorithms by Cormen et al, and have implemented some of the algorithms.

In order to test my implementations I wrote some glue code to do file io, then made some sample input by hand and some more sample input by writing programs that generate sample input.

However I am doubtful as to the quality of my own sample inputs -- corner cases; I may have missed the more interesting possibilities; I may have miscalculated the proper output; etc.

Is there a set of test inputs and outputs for various algorithms collected somewhere on the Internet so that I might be able to test my code? I am looking for test data reasonably specific to particular algorithms, rather than contest problems that often involve a problem solving component as well.

I understand that I might have to adjust my code depending on the format the input is collected in (e.g. The various constraints of the inputs; for graph algorithms, the representation of the graph; etc.) although, I am hoping that the change I would have to make would be reasonably trivial.

Edit:

Some particular datasets I am currently looking for are:

  • Lists of numbers
    • Skewed so that Quick sort performs badly.
    • Skewed so that Fibonacci Heap performs particularly well or poorly for specific operations.
  • Graphs (for which High Performance Mark has offered a number of interesting references)
    • Sparse graphs (with specific bounds on number of edges),
    • Dense graphs,

Since, I am still working through the book, if you are in a similar situation as I am, or you just feel the list could be improved, please feel free to edit the list -- some time soon, I may come to need datasets similar to what you are looking for. I am not entirely sure how editing privileges work, but if I have any say over it, I will try to approve it.

like image 736
math4tots Avatar asked Mar 07 '12 02:03

math4tots


1 Answers

I don't know of any one resource which will provide you with sample inputs for all the types of algorithm that Cormen et al cover but for graph datasets here are a couple of references:

Knuth's Stanford Graphbase

and

the Stanford Large Network Dataset Collection

which I stumbled across while looking for the link to the former. You might be interested in this one too:

the Matrix Market

Why not edit your question and let SO know what other types of input you are looking for.

like image 198
High Performance Mark Avatar answered Oct 22 '22 17:10

High Performance Mark