You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Code/Graph+Algorithms/Graph+NonEssentialEdges.swift
+41-48Lines changed: 41 additions & 48 deletions
Original file line number
Diff line number
Diff line change
@@ -20,62 +20,55 @@ public extension Graph
20
20
func findEssentialEdges()->EdgeIDs
21
21
{
22
22
varidsOfEssentialEdges=EdgeIDs()
23
+
24
+
// TODO: Do we even need to create the MEG of the condensation graph here? AS SOON AS our algorithm to find all transitive edges (or inverted: the transitive reduction) correctly returns all edges that ARE NOT in cycles (even if the graph is cyclic) then we only need to filter out the edges which ARE in cycles for which we only need the SCCs ... this is about making the code more straight forward, we'll assess performance much later and based on measurement ...
25
+
26
+
// make condensation graph
27
+
letcondensationGraph=makeCondensationGraph()
28
+
29
+
// remember in which condensation node each original node is contained
// TODO: decomposing the graph into its components is probably legacy from before the algorithm extraction from Codeface ... this also seems to have no performance benefit here ... better just ensure makeCondensationGraph() (or find SCCs) and makeMinimumEquivalentGraph() work on disconnected graphs and then do this algorithm here on the whole graph in one go ...
25
-
// for each component graph individually ...
26
-
forcomponentinfindComponents()
32
+
forcondensationNodein condensationGraph.nodes
27
33
{
28
-
letcomponentGraph=subGraph(nodeIDs: component)
29
-
30
-
// TODO: Do we even need to create the MEG of the condensation graph here? AS SOON AS our algorithm to find all transitive edges (or inverted: the transitive reduction) correctly returns all edges that ARE NOT in cycles (even if the graph is cyclic) then we only need to filter out the edges which ARE in cycles for which we only need the SCCs ... this is about making the code more straight forward, we'll assess performance much later and based on measurement ...
0 commit comments