Argh. Use a matrix or a std::multimap. The key is the current state. The value should be a struct/class that stores the condition to traverse said edge and the new state key if said edge is traversed.
Play around with the std::multimap and you won't be disappointed.