public W FindMinWeight(IGraph <T> graph, IShortestPathOperators <W> @operator)
        {
            this.@operator = @operator;
            if (this.@operator == null)
            {
                throw new ArgumentException("Provide an operator implementation for generic type W during initialization.");
            }

            if (!graph.IsWeightedGraph)
            {
                if ([email protected]() != typeof(int))
                {
                    throw new ArgumentException("Edges of unweighted graphs are assigned an imaginary weight of one (1)." +
                                                "Provide an appropriate IShortestPathOperators<int> operator implementation during initialization.");
                }
            }

            return(findMinWeight(graph.ReferenceVertex, graph.ReferenceVertex,
                                 graph.VerticesCount,
                                 new HashSet <IGraphVertex <T> >(),
                                 new Dictionary <string, W>()));
        }
Esempio n. 2
0
 public FloydWarshallShortestPath(IShortestPathOperators <W> operators)
 {
     this.operators = operators;
 }
 public DijikstraShortestPath(IShortestPathOperators <W> @operator)
 {
     this.@operator = @operator;
 }
Esempio n. 4
0
 public AStarShortestPath(IShortestPathOperators <W> operators, IAStarHeuristic <T, W> heuristic)
 {
     this.operators = operators;
     this.heuristic = heuristic;
 }
Esempio n. 5
0
 public DijikstraShortestPath(IShortestPathOperators <W> operators)
 {
     this.operators = operators;
 }
 public FloydWarshallShortestPath(IShortestPathOperators <W> @operator)
 {
     this.@operator = @operator;
 }
Esempio n. 7
0
 public BellmanFordShortestPath(IShortestPathOperators <W> operators)
 {
     this.operators = operators;
 }
Esempio n. 8
0
 public AStarShortestPath(IShortestPathOperators <W> @operator, IAStarHeuristic <T, W> heuristic)
 {
     this.@operator = @operator;
     this.heuristic = heuristic;
 }
 public BellmanFordShortestPath(IShortestPathOperators <W> @operator)
 {
     this.@operator = @operator;
 }