directed graph traversal

i have the following graph that i am trying to create a sequence out of for the nodes. it's very similar to a DFS traversal excepted nodes may be visited multiple times.  i am trying to find the best algorithm to create the sequence, the final result is listed below (see attached).  note that E should have been 4th but because of the false route, its sequence got updated to 6th (the higher sequence number).

i want to traverse the TRUE route first and then the nearest FALSE route (if there are children conditionals).  

my initial take on the algorithm is this:
1) keep getting sequence until i hit a conditional or end node
2) if hit end node, stop
3) if hit conditional, take the TRUE route
4) once the TRUE route is done, traverse the nearest false route
workflow.jpg
mmingfeilamAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ozoConnect With a Mentor Commented:
So is the only requirement to follow the arrows and visit all nodes?
Breadth-first instead of Depth-first may be better at finding the shortest such path, but is that something you care about?
0
 
ozoCommented:
What is the relationship between the desired sequence and the directed graph?
Is the goal to visit all the nodes?
0
 
mmingfeilamAuthor Commented:
The directed graph is used to show parent/child relationship.  So we go from parent to child in the direction of the arrow. I want to go thru all the nodes, some multiple times, to generate a sequence in case I want to save to DB.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
ozoCommented:
Are there some nodes that you are required to go through multiple times?
Are there requirements on the order other than those imposed by the arrows in the graph?
0
 
mmingfeilamAuthor Commented:
yes, if the arrow brings you back to a node already visited, then you have to reset that node's sequence number to the newer, higher number.  other than that, the arrow determines the order.
0
 
mlmccCommented:
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
All Courses

From novice to tech pro — start learning today.