예제 #1
0
 public TraveledPathData SynchronousSearch(Graph graph, Vertex root, Vertex goal)
 {
     this.graph = graph;
     this.root = root;
     this.goal = goal;
     return this.SyncSearch();
 }
예제 #2
0
 public override void AsynchronousSearch(Graph graph, Vertex root, Vertex goal)
 {
     this.graph = graph;
     this.root = root;
     this.goal = goal;
     new Thread(AsyncSearch).Start();
 }
예제 #3
0
        private void FillDataTableWithMatrix(Graph graph)
        {
            this.Matrix = graph.AsMatrix();
            int n = this.Matrix.GetLength(0);
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    if (this.Matrix[i, j] != this.Matrix[j, i])
                    {
                        MessageBox.Show(string.Format("Error at [{0},{1}]={2} and [{3},{4}]={5}", i, j, this.Matrix[i, j], j, i, this.Matrix[j, i]));
                    }
                }
            }

            c_dataGrid2D.ItemsSource = BindingHelper.GetBindable2DArray<Double>(this.Matrix);
        }
예제 #4
0
 public void Setup()
 {
     g = new Graph("graph_matrix.txt", "heuristic_data.txt");
     br = new Model.BidirectionalSearch();
     gs = new GreedySearch();
 }
예제 #5
0
        private void FillVisioGraphWithGraph(Graph graph)
        {
            this.VisioGraph = new BidirectionalGraph<object, IEdge<object>>();
        
            foreach (var edge in graph.Edges)
            {
                this.VisioGraph.AddVerticesAndEdge(new MyEdge(edge.VerticeFrom, edge.VerticeTo, edge.Weight.ToString(CultureInfo.InvariantCulture),
                                                              Colors.Silver));
            }
            this.graphLayout.Graph = this.VisioGraph;
            

            // get some extra space between vertices
            var overlapRemoval = new GraphSharp.Algorithms.OverlapRemoval.OverlapRemovalParameters();
            overlapRemoval.HorizontalGap = 50;
            overlapRemoval.VerticalGap = 50;
            this.graphLayout.OverlapRemovalParameters = overlapRemoval;
        }