« Back to AAU Project

How to parse a graph in ADOxx?

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
How to parse a graph in ADOxx?
community documentation transformation adoscript
Answer
3/27/14 11:03 AM
How to to calculate possible outcomes of a defined starting object to end of the object's context? Is there any  An implementation of a graph algorithm (search) can be used to perform this logic, specific consideration should be given to:
a) Alternatives in the model (more than one start object)
b) Include submodel references in the calculation
c) Include detection mechanism for potential starts and ends?

RE: How to parse a graph in ADOxx?
Answer
2/4/14 12:51 PM as a reply to Fadi.
Since all models in ADOxx could be intepreted as graphs, graph-based algorithms can be applied. Please find attached the implementation of 2 algorithms that build on a search approach to find all potential paths in a model and return them as a list. The second algorithm builds upon that implementation and adds the functionality to go through all nodes to find the possible paths from this element to the end of the graph. The algorithms dynamically identify the start object (as the object without incoming relations) and end object (as the object without outgoing relations) and als subgraphs are supported.

Attached to this post, the ABL file, implementing the AdoScript can be found. In order to adapt to your needs, have a look at the attached AdoScript file and modify the mapping section at the beginning. The functionality is provided through menu items added to ADOxx.
Attachments: Example model.adl (5.6k), Graph Analysis Library.abl (10.1k), graphSearch.asc (5.5k), graphSearchIndividual.asc (6.0k)

RE: How to parse a graph in ADOxx?
Answer
11/25/14 8:14 AM as a reply to Fadi.
Attached an enhancement of the above to deal with back-loop cycles - the algorithm is enhanced in a sense that only simple paths are considered, meaning that in case of a re-visit of a node/vertex, the recursion skips the node and path.
Attachments: graphSearchV2.asc (5.4k)