The answers above cover it. I just find it amusing you're trying to do something very similar to what I'm currently working on, but I'm in C++. My graph inputs are circuit netlists. I ended up writing my own simple graph implementation because the one in boost was just incomprehensible.