Apparently, calling add_edge(1,3,G) adds vertices to the chart if necessary. Your first call in this case. Then he adds an edge from vertex 1 to vertex 3. Note that after this call, the number of vertices is 4, since the vertices are then indexed from 0 to 3.
A subsequent call to remove_edge(1,3,G) removes the edge just added, but leaves the number of vertices unchanged.
On the other hand, calling edge(1,3,G) does not add any vertices to the graph; the boolean in the return should indicate whether vertices 1 and 3 are connected or not. There is an access violation, you remove add_edge because the vertices in indexes 1 and 3 do not exist.
You can simply initialize the chart with the required number of vertices:
graph_t G(4);
Raffi source share