Graph HW2

The format of a triangulation file is a sequence of vertices numbered from 1, followed by a sequence of triangles given by three vertices. Example:

VERTICES 50
4.3943722230209445  15.415607000180948
17.65501201136214   4.661809724765199
3.137045515271147   13.337239648000661
[...]
TRIANGLES 89
1   4   5
1   3   4
1   3   8
1   8   46
[...]

The dual graph of a graph G has one vertex for each face (triangle) in the original graph G, and one edge for every adjacent face (edge in original graph). Note: in spite of what you see on Wikipedia, we will not make a vertex for the “infinite face” = the outside of the graph.

Here is the triangulation-reading code or in my site.

Your job is to produce a graph (like the MGraph from class) that represents the dual graph of a triangulation.

Sample data: triangulations with 50 vertices and 100 vertices.