I am having problems starting my assignment. I was wondering if anyone could help me. I have attached the assignment so you guys can view it. I just need some guidance through this assignment. I am usual quick to learn. I am planning to do a arraylist instead of linklist.
This is my code so far...
Vertex Class
public class Vertex { String vertexName; }
Graph Class
import java.io.File; import java.util.ArrayList; import java.util.Scanner; import java.io.FileNotFoundException; public class Graph { public static String readFile() { File mapping = new File("mapping.txt"); Scanner input = null; try { input = new Scanner(mapping); }catch(FileNotFoundException e){ System.out.println("Sorry, that file name is not found"); } String dataFile = ""; while(input.hasNext()) { dataFile += input.next(); } return dataFile; } public void useAlgorithm(Vertex startVertex,Vertex endVertex) { } public String toString() { return "hey"; } public static void main(String[]args) { System.out.println(readFile()); } }
Edge Class
public class Edge { String startVertices; String endVertices; Double edge; }
MappingApp Class
public class MappingApp { public static void main (String[]args) { } }
Background Information
Have you ever wondered how websites like Google Maps can give you directions from point A to point B? One solution involves the use of graph theory and a wellknown procedure known as Dijkstra’s algorithm.
First, some basics! As you may have learned from your math classes, a graph is just a collection of vertices (also known as nodes) that may be connected by edges. In a weighted graph, these edges are associated with numerical values. Think of the vertices as representing particular locations, and the edges as representing the distance (or more generally, “cost” of traveling) between two vertices.
Here’s an example of what a simple graph might look like (not drawn to scale):
Attached File(s)

A.pdf (219.94K)
Number of downloads: 325