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
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
See: https://github.com/JPL-IMCE/gov.nasa.jpl.imce.ontologies.tools/blob/861e95f779394dbfaabdcc04b149c6c076fa4b73/lib/BundleClosure/lib/graph.rb
In the above, need to improve the checks to make sure that an edge is added if and only if
both
edge.souceandedge.targetare not ins