public static Graph buildGraphFromDot(String filename) {
		// creates a new, empty graph (CHANGE AS NEEDED)
		Graph g = new Graph();

		Scanner s = null;
		try {
			s = new Scanner(new File(filename)).useDelimiter(";|\n");
		} catch (FileNotFoundException e) {
			System.out.println(e.getMessage());
		}

		// Determine if graph is directed or not (i.e., look for "digraph id {" or
		// "graph id {")
		String line = "", edgeOp = "";
		while (s.hasNext()) {
			line = s.next();

			// Skip //-style comments.
			line = line.replaceFirst("//.*", "");

			if (line.indexOf("digraph") >= 0) {
				g.setDirected(true); // Denotes that graph is directed (CHANGE AS NEEDED)
				edgeOp = "->";
				line = line.replaceFirst(".*\\{", "");
				break;
			}
			if (line.indexOf("graph") >= 0) {
				g.setDirected(false); // Denotes that graph is undirected (CHANGE AS NEEDED)
				edgeOp = "--";
				line = line.replaceFirst(".*\\{", "");
				break;
			}
		}

		// Look for edge operators -- (or ->) and determine the left and right
		// vertices for each edge.
		while (s.hasNext()) {
			String[] substring = line.split(edgeOp);

			for (int i = 0; i < substring.length - 1; i += 2) {
				// remove " and trim whitespace from node string on the left
				String vertex1 = substring[0].replace("\"", "").trim();
				// if string is empty, try again
				if (vertex1.equals(""))
					continue;

				// do the same for the node string on the right
				String vertex2 = substring[1].replace("\"", "").trim();
				if (vertex2.equals(""))
					continue;

				// add edge between vertex1 and vertex2 (CHANGE AS NEEDED)
				g.addEdge(vertex1, vertex2);
			}

			// do until the "}" has been read
			if (substring[substring.length - 1].indexOf("}") >= 0)
				break;

			line = s.next();

			// Skip //-style comments.
			line = line.replaceFirst("//.*", "");
		}

		return g;
	}