Convert an event as a node graph action to a node graph event

Does anyone know where I can find the implementation of the algorithm for converting the activity of a node graph (aka activity-to-node graph) on an event node graph (aka activiy-on-arrow graph)

If you don't know what I'm talking about, look here: http://www.brpreiss.com/books/opus7/html/page581.html

Please provide a working answer in your answer.

Thanks in advance.

+3
source share
3 answers

- node v v_in v_out, , . (u, v) u_out v_in .

+3

, :

- node - - . , - . , , . , . graph event-node.

, . , node event node, - node node , .

node node , , A->B->C A->A'->B->B'->C-C'. node, , , .

+1
foreach node in graph
      if count of incoming_arrows != 1
      {
         Create new node
         Assign incoming arrows from old node to new node
         Create arrow from new node to old node
         Assign cost 0 to new node             
      }
      endif
end foreach

foreach arrow in graph
         Assign cost of destination node to cost of arrow
         /* if you want ...preceded by "node name:" to get F:5 */
end foreach

Rename the nodes

The required data structures are something like

 struct node
     node_name string
     node_cost int
 struct arrow
      arrow_form_node node
      arrow_to_node node
      arrow_cost int
+1
source

Source: https://habr.com/ru/post/1746792/


All Articles