Exemplo n.º 1
0
 public DijkstraShortestPathAlg(GraphAirports graph)
 {
     determined_airports_set      = new List <airport>();
     airports_candidate_queue     = new VPriorityQueue <airport>();
     start_airport_distance_index = new Dictionary <int, double>();
     predecessor_index            = new Dictionary <int, airport>();
     this.graph = graph;
 }
        public YenTopKShortestPathsAlg(GraphAirports graph)
        {
            result_list = new List <Path>();
            path_derivation_airport_index = new Dictionary <Path, airport>();
            path_candidates = new PriorityQueue <Path>();

            if (graph == null)
            {
                throw new ArgumentException("A NULL graph object occurs!");
            }

            graph          = new VariableGraph((GraphAirports)graph);
            source_airport = null;
            target_airport = null;

            _init();
        }
Exemplo n.º 3
0
        public GraphAirports(GraphAirports graph)
        {
            DISCONNECTED = double.MaxValue;

            // index of fan-outs of one vertex
            fanout_airports_index = new Dictionary <int, List <airport> >(graph.fanin_airports_index);

            fanin_airports_index = new Dictionary <int, List <airport> >(graph.fanin_airports_index);

            airports_pair_distance_index = new Dictionary <KeyValuePair <int, int>, double>(graph.airports_pair_distance_index);

            // index for vertices in the graph
            id_airports_index = new Dictionary <int, airport>(graph.id_airports_index);

            // list of vertices in the graph
            airports_list = new List <airport>(graph.airports_list);

            // the number of vertices in the graph
            airports_num = graph.airports_num;

            // the number of arcs in the graph
            routes_num = graph.routes_num;
        }
Exemplo n.º 4
0
 public VariableGraph(GraphAirports graph)
     : base(graph)
 {
     rem_airport_id_set = new List <int>();
     rem_route_set      = new List <KeyValuePair <int, int> >();
 }