anonymous edges

Since version 1.05.0493 (0503), Cyclone now supports anonymous edges.

Anonymous edges

In a cyclone specification, users can create a set of anonymous edges without explicitly defining edges one by one. This can simplify a cyclone specification. Currently, there are two operators can be used to create anonymous edges.

Star *

A star represents all the nodes in a graph including the source node itself. The syntax as follows:

edge { Src -> * }

This creates a set of edges from the source node (Src) to every other nodes in a graph including Src itself.

Plus +

A star represents all the nodes in a graph excluding the source node. The syntax as follows:

edge { Src -> + }

This creates a set of edges from the source node (Src) to every other nodes in a graph excluding Src itself.

Bidirectional <->

A bidirectional sign represents two connections. The syntax as follows:

edge { Src <-> Tar }

This creates two edges: one from the source node (Src) to the target node (Tar) and another from the target node back to the source node.

Examples

A graph has 6 nodes: S0, S1, S2, S3, S4 and S5. The following code

edge { S0 -> * }

creates a set of anonymous edges that are equivalent to creating the following edges:

edge t0 { S0 -> S0 }

edge t1 { S0 -> S1 }

edge t2 { S0 -> S2 }

edge t3 { S0 -> S3 }

edge t3 { S0 -> S4 }

edge t3 { S0 -> S5 }

Similarly, the following code

edge { S0 -> + }

creates a set of anonymous edges that are equivalent to creating the following edges:

edge t0 { S0 -> S1 }

edge t1 { S0 -> S2 }

edge t2 { S0 -> S3 }

edge t3 { S0 -> S4 }

edge t4 { S0 -> S5 }

Note: For both Star and Plus, they can only be used in specifying target nodes.

 


@2020-2022 Hao Wu. All rights reserved. Last update: January 29, 2022