algorithm - find all non-repeating paths through a set of connected nodes/process diagram -


I am trying to understand whether a certain process diagram in any appropriate way

  • < Li> They have one or more starting points
  • They have one or more end
  • One of the starting points is the Connector Leader
  • In all stages There are at least one or more inbound connectors and one or more outbound connectors
  • If there is more than one of the following names Hey:
    • Start the Terminator
    • Termination Terminator
    • One-Step Connection leading to

      I have access to all the data that I can imagine to be necessary (finding all the starting points, getting all connections, connection names etc).

      I basically want to find many unique paths from the starting point through the process at the end point, where you do not round in the circle again and again. You can go through a single step several times, but you can not repeat more than once the circuit through any route.

      It would have written a papers about the type of people and its evidence is why it can be done or not, I just do not know the word of the magic which I need Google ;-) Code or similar would be ideal (and surprisingly), but if someone can talk to me then I am happy to read my own right direction.

      Any search rule suggestion is very welcome and much appreciated

      Note Extra "Stupid" possibilities by humans It has to be reviewed - it will still be interesting to see what it was born.

      An example to clarify things:

        G < - 2-E & lt; - 1-F-2-- | | | ^ | | 1 | | | | 2 | \ / \ / | \ / Start --- & gt; A-> B ---- & gt; C-1-> D --- end   

      through some routes:

      • Start, A, B, C: 1, D, End < Li> A, B, C: 2, F: 1, E: 2, A, B, C, 2, F: 1, E: 1, B, C: 1
      • G, A, B, C: 1, D, End
      • , A, B, C: 2, F: 2, D, End

        Good About another interesting thing:

        • Start, A, B, C: 2, F: 1, E: 2, G, A, B, C: 2, F: 1, B, C: 2, F: 2, D, End

          I hit C three times and every time I select option two and repeat one Does not.

          Extra Points : I was thinking that I can mark several nodes with many outbound connectors, being compatible with any performance of a process. If there is a "written code" process in which there is a decision point "language" with two outbound connectors "C #" and "Java", then I can say that in any execution of this process it will always be C # or Java - Which is the process Never changed during Padn. Like "There are insects?" Yes, after the first pass, yes, then through the second pass (after some fixed bug steps ;-) the result no. Maybe

          Do you know any rules or techniques related to this kind of additional analysis / processing / definition?

          Edit: I implemented an example solution in Jason based on God's answer.

          How about searching deeply before? It must walk through all possible paths. The only difficult part is ignoring the paths that will take the same cycle again. If you are on the node, then you should check whether you were before (a circle) before, and make sure that the same sequence is not already in the path

          for example

            start, a, b, c: 2, f: 1, e: 1, b, c: 2, f: 1, e: 1, b   

          From here, we can go to C only. (The last 4 nodes), we got the cycle C: 2, F: 1, E: 1, B . The cycle is already present, so we can not go to node C. Since we can not go anywhere, this branch does not give the correct path.

          pseudocode:

            allpaths (path, node) cycle = path.substring (path.lastIndex (node)) + node if path.contains (cycle) returns path = Path + node if all paths (path, child) in node.children / div> 

  • Comments

    Popular posts from this blog

    mysql - BLOB/TEXT column 'value' used in key specification without a key length -

    c# - Using Vici cool Storage with monodroid -

    python - referencing a variable in another function? -