package labs.graphs;

import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;

/**
 * Utility class providing some basic graph algorithms. 
 * 
 * @author CS 240 Instructors and ??
 *
 */

public class GraphAlgorithms {

  /**
   * Return the out degree of vertex v.
   */
  public static <T> int getOutDegreeOfVertex(Graph<T> graph, int vertex) {

    // TODO

    return -1;

  }

  /**
   * Return the in degree of vertex v.
   */
  public static <T> int getInDegreeOfVertex(Graph<T> graph, int vertex) {
   
    // TODO
    
    return -1;
    
  }

  /**
   * Returns true if the graph is connected. (This method should only be applied
   * to undirected graphs.)
   * 
   * This method will use the Boolean values stored at the nodes to keep track of
   * which nodes have been visited.
   */
  public static boolean isConnected(Graph<Boolean> graph) {
    
    // TODO

    // The algorithm proceeds in three stages:
    // 1. First, set the value for all nodes to false to indicate that they have not
    //    been visited
    // 2. Call dfs to perform a depth-first traversal starting at any node.
    // 3. Return true if all nodes were visited during the traversal, false
    //    otherwise.

    return false;

  }

  /**
   * Perform a recursive DFS traversal of the provided graph starting at the
   * indicated vertex. This method will set the boolean value of the provided
   * vertex to true to indicated that it has been visited.
   */
  public static void dfs(Graph<Boolean> graph, int vertex) {

    // TODO

  }
}
