I'm trying to model a questionnaire where the flow between questions depends on the answers given in previous questions.
Example. (Node represent questions, edges represent answers).
As you can see there are 2 parallel edges from nodes A to B, each representing an answer to the first question (node A). Node B (the second question) has 4 edges but they each depend on both the answer to A and the answer to B.
i.e. A > 1 > B > 1 > C (answering 1 to the first question means that only the green edges from B are "valid").
A secondary question (and the actual question I'm looking to answer) would be, given a graph like the above (of arbitrary complexity), is there a generalised algorithm to determine which edges are "valid" / "invalid" depending on the route taken?
Any guidance much appreciated!