Automatic ticket generator

2

I'm developing the Dijkstra minimum path calculation algorithm using C language, I'm making several solutions to the same problem and then testing which one is most efficient.

For this I needed to generate multiple entries, including huge entries! I would like to know if there is an input generator or something, otherwise I will have to write an algorithm to generate the connected and connected graphs in the hand and store them in a txt

Is there something like this?

    
asked by anonymous 20.09.2014 / 19:46

1 answer

3

I'm assuming you're looking for random entries, right? In this Wikipedia article on "random graphs" we cite several different algorithms to generate a graph, each with distinct properties (and different implementation complexity). See "templates" in the information box on the right, on Wikipedia in English there are a few others.

I do not know of any ready-made implementation, but maybe you find something like this in the library LEMON (part of the Boost project) - for C ++ however, not C. And anyway, you would have to "translate" output of any ready-to-format tool you're using to represent, so I do not know what would give more work: use a ready tool, or implement yourself ...

If you decide to implement yourself, the Erdõs-Rényi Template a> seems to be the simplest. In one of its two variants:

  • Choose a% probability of% between zero and one (zero: no edge, one: fully connected graph);
  • Create a graph with p nodes;
  • For each pair of nodes n , create or not an edge between them with probability (a,b) .
  • Other models produce graphs with different characteristics (eg the Barabási-Albert

    20.09.2014 / 20:31