// Path: Labs/resources/net/datastructures/Edge.java
// public interface Edge<E> {
//   /** Returns the element associated with the edge. */
//   E getElement();
// }
// 
// Path: Labs/resources/net/datastructures/Vertex.java
// public interface Vertex<V> {
//   /** Returns the element associated with the vertex. */
//   V getElement();
// }


import net.datastructures.Edge;
import net.datastructures.Vertex;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Hashtable;


public class BuildItinerary {

    AdjacencyListGraph<TimeAtAirport, Flight> graph;

    public BuildItinerary(ArrayList<Flight> flights) {

        buildGraph(flights);

    }

    private void buildGraph(ArrayList<Flight> flights) {
        graph = new AdjacencyListGraph<>(true); //empty directed graph

        // Insert vertices and edges for all flight legs
// Path: Labs/resources/net/datastructures/Edge.java
// public interface Edge<E> {
//   /** Returns the element associated with the edge. */
//   E getElement();
// }
// 
// Path: Labs/resources/net/datastructures/Vertex.java
// public interface Vertex<V> {
//   /** Returns the element associated with the vertex. */
//   V getElement();
// }


// Path: Assignments/Assignment 5/BuildItinerary.java
import net.datastructures.Edge;
import net.datastructures.Vertex;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Hashtable;



public class BuildItinerary {

    AdjacencyListGraph<TimeAtAirport, Flight> graph;

    public BuildItinerary(ArrayList<Flight> flights) {

        buildGraph(flights);

    }

    private void buildGraph(ArrayList<Flight> flights) {
        graph = new AdjacencyListGraph<>(true); //empty directed graph

        // Insert vertices and edges for all flight legs
        Hashtable<TimeAtAirport, Vertex<TimeAtAirport>> vertices = new Hashtable<>();