1. thomas_bartscher
  2. cl-fgraph

Commits

Thomas Bartscher  committed 693bfd8

SANITIZED-GRAPH generic function for GRAPH protocol added.

  • Participants
  • Parent commits 69de9e6
  • Branches dev

Comments (0)

Files changed (1)

File source/graph/graph.lisp

View file
 (defgeneric induced-graph (graph nodes)
   (:documentation "Returns the graph induced by NODES in GRAPH."))
 
+(defgeneric sanitized-graph (graph)
+  (:documentation "Returns a graph where all nodes reached by edges
+  are in the graph.")
+  (:method ((graph graph))
+    (induced-graph graph (nodes graph))))
+
 (defgeneric graph-union (graph1 graph2)
   (:documentation "Returns the union of GRAPH1 and GRAPH2."))