road map alike data structure

Started by
4 comments, last by jwezorek 13 years, 12 months ago
Dear all, does anyone know of a library that implements a data structure similar to road maps? I would need to keep track of several points (crossroads), and an undefined number of connections between them. Note that the connections have properties of their own, so they can't just be pointers to other points. I have a design ready, but it has a butload of lists of pointers going back and forth from "points" to "connections" and back and I'm afraid I'll get into trouble with dangling pointers in the destructors. for example: deleting a point means deleting all connections to this point, this means that all points connected to the deleted one need to have their connection updated to avoid them having pointers to deleted connections. and that's just deleting one point, imagine what would happen if someone were to delete a mixt series of points and connections... It's a nuclear disaster waiting to happen. Greetings, TH PS I'm using C++
Advertisement
http://www.boost.org/doc/libs/1_41_0/libs/graph/doc/table_of_contents.html

Boost::graph?

Well,

I've been reading some nasty things about boost::graph and i can't find any tutorials or decent documentation.

Has anybody used the LEMON library?

It seems quite nice...
What bad things did you read about boost::graph? -- The only problem I've ever had with the boost graph library is that a million years ago Visual Studio used to choke on it, but that was a million years ago. As for documentation, well, I mean... what more can you ask for

I've never used LEMON but I've used other COIN-OR projects without problems.

By nasty things i mean this. Granted, the posts are 4 years old.

And as for documentation, since this is just a hobby of mine, i'm not going to spend 40 dollars for a tutorial on each library i want to use. There is online documentation, but one has to admit it is not very clear...
Quote:Original post by twoaterisn
By nasty things i mean this. Granted, the posts are 4 years old.

The people in that thread sound like they are talking about boost::spirit -- anyway if they were talking about Spirit I'd be more sympathetic.

The boost graph library really isn't that bad and is in fact not a crazy example of bleeding edge template metaprogramming for the sake of template metaprogramming in my opinion. It's a template libary, yes, but the way in which it uses templates is pretty standard nowadays. I mean, LEMON looks like it is a template library too, ... but, you know, your mileage may vary. My advice would be to pick one and try it; just don't try to use BGL with an old or non-conforming compiler.

Quote:Original post by twoaterisn
And as for documentation, since this is just a hobby of mine, i'm not going to spend 40 dollars for a tutorial on each library i want to use. There is online documentation, but one has to admit it is not very clear...


The online documentation could be better but that's true of every 3rd party library you will ever use in your life. I don't own the book so I can't vouch for it but you might try these places they used to have called public libraries :)

---
You know, the other thing is you haven't told us what you want to do with graphs. The main reason, in my opinion, to use one of these libraries is that BGL at least provides an implementation for pretty much any graph algorithm that you can name and some of them aren't the easiest things in the world to reproduce yourself. However, if all you need is a DFS or BFS or something you could just skip the libararies and use your own data structure.

[Edited by - jwezorek on April 28, 2010 2:26:39 PM]

This topic is closed to new replies.

Advertisement