Class AirCanada

java.lang.Object
  extended byAirCanada

public class AirCanada
extends java.lang.Object

This class implements a method for determining a set of JetsGo routes that Air Canada should add to their flight network


Constructor Summary
AirCanada()
           
 
Method Summary
static Graph FindRoutes(int n, java.util.Collection edges, double ignore)
          This method takes as a parameter an *undirected* graph represented by the number of its nodes and a collection of edges.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AirCanada

public AirCanada()
Method Detail

FindRoutes

public static Graph FindRoutes(int n,
                               java.util.Collection edges,
                               double ignore)
This method takes as a parameter an *undirected* graph represented by the number of its nodes and a collection of edges. The method finds a subgraph such that there exists a path from any one vertex to another. The method returns a graph that consists of a select set of edges from this subgraph such that their total weight (cost) is minimized and does not include edges whose weight equals the parameter ignore. You can assume that the vertices of the graph are 0..n-1.

Parameters:
n - the number of nodes of the graph.
edges - a collection that contains the set of edges of the graph.
ignore - the weight of the edges that should not be returned in the set of routes.
Returns:
a graph consisting of a subset of edges from a subgraph G of the input graph, such that the total weight (cost) of the edges is minimized and does not include edges whose weight equals the parameter ignore. G is a connected subgraph of the input graph.