Closed sraaphorst closed 6 years ago
I was worried that this would cause problems if the underlying graph in GraphMaze
was copied, as I saw this happen without careful implementation (and multiple graphs get consecutive vertices, it seems), but so far, now, I have not been able to reproduce this.
There is now a package,
GraphMaze
, which uses Boost.Graph to represent thin mazes. In order to test it, I implemented the typeclassesHomomorphism
fromGraphMaze
toMaze
and vice-versa (since it is an isomorphism), andShow
forGraphMaze
, which just maps through the homomorphism toMaze
and usesShow<Maze>
.This appears to be working fine, as verified in the
test_isomorphism
app, which takes a DFSMaze
, isomorphically maps it to aGraphMaze
,show
s it (which uses the reverse homomorphism), and then explicitly calls the isomorphism to map theGraphMaze
back to theMaze
, andshow
s that. The results are consistent.