Detects SubstructureItemss that represent isolated stars in the specified graph.
Remarks
A star consists of a root
that is connected to multiple nodes with degree one.
Since a star only consists of elements with the same edgeDirectedness and nodeTypes, a root may be associated with different stars. In this case, the algorithm only returns the largest star.
The edgeDirectedness is considered as follows: A substructure is only identified as such if all edges are either undirected or consistently directed with respect to the specified directedness.
- A directedness value of
1
indicates that the edge is considered to be directed from source to target. - A directedness value of
-1
indicates that the edge is considered to be directed from target to source. - A directedness value of
0
indicates that the edge is considered to be undirected.
Examples
Type Details
- yfiles module
- view-layout-bridge
- yfiles-umd modules
- view-layout-bridge
- Legacy UMD name
- yfiles.analysis.StarSubstructures
See Also
2
.Constructors
Creates a new instance of this class.
Parameters
A map of options to pass to the method.
- minimumSize - number
The minimum size of a star. This option sets the minimumSize property on the created object.
- nodeTypes - ItemMapping<INode,Object>
A mapping which maps the type of each node. This option sets the nodeTypes property on the created object.
- edgeDirectedness - ItemMapping<IEdge,number>
A mapping that stores the directedness of the edges. This option sets the edgeDirectedness property on the created object.
- subgraphNodes - ItemCollection<INode>
The collection of nodes which define a subset of the graph for the algorithms to work on. This option sets the subgraphNodes property on the created object.
- subgraphEdges - ItemCollection<IEdge>
The collection of edges which define a subset of the graph for the algorithms to work on. This option sets the subgraphEdges property on the created object.
Properties
Gets or sets a mapping that stores the directedness of the edges.
Remarks
- the edge's directedness is greater than
0.0
and the edge is incoming (i.e. n is the edge's target), - the edge's directedness is smaller than
0.0
and the edge is outgoing (i.e. n is the edge's source), - or the edge's directedness is
0.0
(i.e. the edge is considered to be undirected).
Gets or sets the minimum size of a star.
Remarks
Stars with less nodes are ignored.
Default is 2
.
2
.Gets or sets a mapping which maps the type of each node.
Remarks
An arbitrary object. Nodes returning equal objects are considered to be of the same type.
If none is provided, all nodes are considered as equal.
Gets or sets the collection of edges which define a subset of the graph for the algorithms to work on.
Remarks
If nothing is set, all edges of the graph will be processed.
If only the excludes are set all edges in the graph except those provided in the excludes are processed.
Note that edges which start or end at nodes which are not in the subgraphNodes are automatically not considered by the algorithm.
ItemCollection<T> instances may be shared among algorithm instances and will be (re-)evaluated upon (re-)execution of the algorithm.
Examples
Gets or sets the collection of nodes which define a subset of the graph for the algorithms to work on.
Remarks
If nothing is set, all nodes of the graph will be processed.
If only the excludes are set all nodes in the graph except those provided in the excludes are processed.
ItemCollection<T> instances may be shared among algorithm instances and will be (re-)evaluated upon (re-)execution of the algorithm.
Examples
Methods
Returns a list of SubstructureItemss that represent isolated stars in the specified graph.
Remarks
A star consists of a root
that is connected to multiple nodes with degree one.
Since a star only consists of elements with the same edgeDirectedness and nodeTypes, a root may be associated with different stars. In this case, the algorithm only returns the largest star.
A star only consists of elements with the same nodeTypes, i.e., nodes associated with equal objects. If no nodeTypes is specified, all node are considered to be of the same type.
The edgeDirectedness is considered as follows: A substructure is only identified as such if all edges are either undirected or consistently directed with respect to the specified directedness.
- A directedness value of
1
indicates that the edge is considered to be directed from source to target. - A directedness value of
-1
indicates that the edge is considered to be directed from target to source. - A directedness value of
0
indicates that the edge is considered to be undirected.
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph to find the substructures in.
Returns
- ↪StarSubstructuresResult
- A list of SubstructureItemss that represent the stars.
Throws
- Exception({ name: 'InvalidOperationError' })
- If the algorithm can't create a valid result due to an invalid graph structure or wrongly configured properties.
Examples
2
.