Mathematica Shortest Path Min / Max Flow on Random Graphs

We present here a simple program to generate a variety of random graphs with a variable number of vertices and edges and Random edge weights, either directed or undirected.  You can put an insane number of vertices in and it will run ... but it will take a while...

Compute Shortest Path Max / Min Flow on Random Graph

If you want the Random graph to be directed you can change the DirectedEdges-> parameter in the RandomGraph[] function.  Also if you want a different number of vertices or edge density you ad adjust the numVertices, numEdges parameters as it suites you.  Here is an example output.  Edge weights are distributed uniform randomly over [0, 1].

Shortest Path through Random Graph
Maximum Flow
Min Flow Cost

Here is a shortest path plot with 1500 nodes.  It works but it gets difficult to visualize at this scale...  You can sort of see the red vertices in there right? 🙂

1500 Vertices Shortest Path

You can download the Mathematica notebook for this post here.