@@ -0,0 +1,909 @@
+package bfs;%0A%0A/*%0A%09This class defines a vertex for Breadth First Search algorithm.%0A*/%0A%0Aclass Vertex%7B%0A%0A%09private int name = -1;%09%09%09%09%09// vertex name%0A%09private int parent = -1;%09%09%09%09// parent vertex's name in bfs tree%0A%09private int distance = -1;%09%09%09%09// shortest distance from source vertex%0A%09private char color = 'w';%09%09%09%09%09// color of vertex%0A%0A%0A%09// Constructs vertex with specified name%0A%0A%09public Vertex(int name)%7B%0A%0A%09%09this.name = name;%0A%09%7D%0A%0A%0A%09// Returns name%0A%0A%09public int getName()%7B%0A%0A%09%09return name;%0A%09%7D%0A%0A%09// Returns parent's name%0A%0A%09public int getParent()%7B%0A%0A%09%09return parent;%0A%09%7D%0A%0A%09// Returns distance%0A%0A%09public int getDistance()%7B%0A%0A%09%09return distance;%0A%09%7D%0A%09%0A%09// Returns color%0A%0A%09public char getColor()%7B%0A%0A%09%09return color;%0A%09%7D%0A%0A%09// Sets parent%0A%0A%09public void setParent(int p)%7B%0A%0A%09%09parent = p;%0A%09%7D%0A%0A%09// Sets distance%0A%0A%09public void setDistance(int d)%7B%0A%0A%09%09distance = d;%0A%09%7D%0A%0A%09// Sets color%09%0A%0A%09public void setColor(char c)%7B%0A%0A%09%09color = c;%0A%09%7D%0A%0A%7D%09

Add vertex class for bfs