static void Main(string[] args) { try { String path = args[0]; (IVertexAndEdgeListGraph <int, Edge <int> > graph, Func <Edge <int>, double> edgeCost) = GraphCreator.Create(MatrixReader.Read(path)); TryFunc <int, IEnumerable <Edge <int> > > tryGetPath = graph.ShortestPathsDijkstra(edgeCost, 0); PdfGenerator.Generate(DotGenerator <int, Edge <int> > .GetDotCode(graph, tryGetPath), args[1]); } catch (IndexOutOfRangeException) { Console.Error.WriteLine("Path to graph matrix must be given"); } }
private void BackgroundWorkerReader_DoWork(object sender, DoWorkEventArgs e) { var path = e.Argument as string; e.Result = MatrixReader.Read(path); }