Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 5. Composite > Consequences of Cycles

Consequences of Cycles

Many operations on a composite, such as counting its number of leaf nodes, make sense even if the composite is not a tree. Usually, the only difference that nontree composites introduce is that you have to be careful not to operate on a given node twice. However, some operations become meaningless if the composite contains a cycle. For example, we can’t algorithmically determine the maximum number of steps that might be required to make an aerial shell at Oozinoz, because the rework step may be repeated an arbitrarily large number of times. Any operation that depends on the length of a path in a composite won’t make sense if the composite contains a cycle. So, although we can talk about the height of a tree—the longest path from the root to a leaf—there is no maximum-length path in a cyclic graph.

Another result of allowing composites that are not trees is that you lose the ability to assume that each node has a single parent. If a composite is not a tree, a node may have more than one parent. For example, the process that Figure 5.8 models might have several composite steps that use the inspect step, giving the inspect object multiple parents. There is no inherent problem in a node’s having multiple parents, but your model and code must then take that into account.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint