
19 Nov
2012
19 Nov
'12
9:58 p.m.
This isn't a Boost Graph problem per se, just a graph algorithm question. Let's say I have the following graph: I want to represent this graph in a certain way. In the small legend box above, there are 2 versions of a correct answer. I want to print out each vertex followed by it's immediate adjacent vertex. If it has more than one, then each path from that point should be wrapped in a '()'. Currently, I am using the Ruby RGL package and have tried both a directed and an undirected graph using a depth first search traversal, and have yet to hit on an algorithm that takes every edge case. Anyone out there have some pointers on how to do this? Thanks! Birch