Boost logo

Boost :

Subject: [boost] Graph Algorithm Advice
From: J Birch (birchsport_at_[hidden])
Date: 2012-11-19 16:58:42


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk