documentationfor yFiles for HTML 3.0.0.3

FeedbackEdgeSet

Finds edges of a given graph whose removal or reversal would make the graph acyclic (also called Feedback Arc Set).

Inheritance Hierarchy
FeedbackEdgeSet

Remarks

This minimization is performed heuristically, since it is a well-known hard problem to come up with an optimal solution.

If costs are provided the algorithm tries to minimize the cost associated with the marked edges. Otherwise, a faster algorithm based on a depth-first search is used. This approach also provides more stable results when edges are added or removed over time.

Other Tree-Related Algorithms

@PRODUCT@ supports a number of other algorithms and helpers related to trees:

  • SpanningTree – calculates a (minimum) spanning tree for a graph
  • TreeAnalysis – analyzes directed trees and provides access to tree properties, for example, the root node, the set of leaf nodes, or the depth of a node.

Examples

Highlighting a feedback edge set of a graph
// prepare the feedback set detection algorithm
const algorithm = new FeedbackEdgeSet()
// run the algorithm
const result = algorithm.run(graph)

// highlight the cycle
for (const edge of result.feedbackEdgeSet) {
  graph.setStyle(edge, highlightFeedbackEdgeSetStyle)
}

Type Details

yFiles module
view-layout-bridge

See Also

Constructors

Properties

Methods