Question 1:
From my understanding, a graph is similar to a binary search tree except there is no limit to the number of parents and number of children a node can have. So its a a bunch of nodes linked together with a bunch of edges each carrying a weight, like a flight schedule between cities with each node representing a city and each edge representing the number of miles to that city.
This is my current up to date algorithm
AddVertex(string v)
if statement to check if vertex already exists, if it does don't add another vertex else
set vname = string v
set nextVertex = NULL if graph is empty, else nextVertex will be the vertex added before this.
AddEdge(string s, string d, int w)
if statement is edge already exists between two nodes with same weight, don't add same edge else
figure out starting vertex (string s)
declare new EdgeNode variable
set var->destination->vname = string d
set var->weight = w
point nextEdge to another edge coming from same vertex
Question 2:
From what I read (in my book) the red box in the following picture is the first edge, and the orange box in the picture is the second edge and so on and so forth for each vertex.
http://imgur.com/a2kd1ES
Also, I've made no real progress on my own, just been writing new code and still get seg faults.