I would like to have a relatively small and simple tree in C++. Each node would contain an integer. The tree should be traversable both ways.
I know it can be done with tree.hh by Kasper Peeters, but I am going to use BGL for other purposes as well. I've been learning BGL for some time, but don't have a firm grasp on the concept yet.
The main requirement is the ease of programming (concise code is desirable), traversing and editability. Space and performance aren't likely to be a consideration.
I would appreciate the advice on the concept. My guess the graph should be bidirectional (as I need to be able to access children and parents).
How do I enforce the tree structure? Is the requirement of a single parent sufficient? Should I have an artificial root node in case of multiple orphaned nodes? What is the best way of quickly accessing the node if I know the value?
P.S. I originally posted this question on Stack Overflow and one of the comments suggested this site.