Search
Checking the Document Structure

It is often useful to find out if there is a path connecting two diagram items or if an item is part of a cycle. The following groups of functions can be used for these purposes:

For finding paths use the FindShortestPath, FindLongestPath, FindLongestPathBetween or FindAllPaths methods. They return the first path found; the other paths are stored in a buffer and can be retrieved from it using the PathCount property and GetPath method.

You can test for cycles using DetectCycle for specific object or FindCycle to find out any cycle in the diagram. As in the case with paths the cycles are stored in buffer, from which can be retrieved using CycleCount and GetCycle.

Another useful method - IsTree - checks if the current graph of diagram objects represent a tree.