-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
def merge_vertices(s)
new_vertex = Union.new(s.inject(Set.new) { |m, o| m = m.union(o.classes) })
g = RGL::DirectedAdjacencyGraph.new
edges.each do |edge|
if s.include?(edge.target)
g.add_edge(edge.source, new_vertex)
elsif s.include?(edge.source)
g.add_edge(new_vertex, edge.target)
else
g.add_edge(edge.source, edge.target)
end
end
Graph.new(g.transitive_reduction)
end
In the above, need to improve the checks to make sure that an edge is added if and only if
both edge.souce
and edge.target
are not in s
Metadata
Metadata
Assignees
Labels
No labels