class COMPARABLE_GRAPH [V -> COMPARABLE] General cluster: mathmodels description: "Descendant of GRAPH[V] where V is now COMPARABLE. Mathematical model for a Directed Graph = (vertices, edges) where vertices is a set of comparable vertices in generic parameter V, and edges is a relation in vertices: vertices: SET [V] edges: REL [V, V] Inherits immutable queries and commands to add and remove vertices and edges. Also derived queries for outgoing and incoming edges: outgoing (v: V): REL[V, V] incoming (v: V): REL[V, V] adjacent (v: V): SEQ [V] adjacent is redefined as sorted sequence of (comprable) vertices to uniquely define shortest paths etc. Derived queries such as: reachable (src: V): SEQ[V] shortest_path(v1, v2: V): detachable SEQ[V] where reachable uses breadth-first search starting with vertex src, to return the set of all nodes reachable from src. shortest_path returns the shortest path between v1 and v2 if it exists. Also has queries for cycles and topological sort." create: make_empty, make_from_tuple_array Ancestors GRAPH [V -> attached ANY] Queries adjacent (v: V): SEQ [V] array_compare (a, b: ARRAY [TUPLE [V, V]]): BOOLEAN as_array: ARRAY [TUPLE [V, V]] cycle (v: V): detachable SEQ [V] debug_output: STRING_8 edge_count: INTEGER_32 edge_extended alias "|\/|" (e: PAIR [V, V]): [like Current] COMPARABLE_GRAPH [V] edge_removed alias "|\" (e: PAIR [V, V]): [like Current] COMPARABLE_GRAPH [V] edges: REL [V, V] has_edge (p: PAIR [V, V]): BOOLEAN has_vertex (v: V): BOOLEAN in_degree_count (v: V): INTEGER_32 incoming (v: V): REL [V, V] Infinity: INTEGER_64 is_a_shortest_path (v1, v2: V; seq: SEQ [V]): BOOLEAN is_acyclic: BOOLEAN is_empty: BOOLEAN is_equal (other: [like Current] COMPARABLE_GRAPH [V]): BOOLEAN is_reachable (v1, v2: V): BOOLEAN is_subgraph alias "|<:" (other: [like Current] COMPARABLE_GRAPH [V]): BOOLEAN is_topologically_sorted (seq: [like topologically_sorted] SEQ [V]): BOOLEAN is_valid_path (seq: SEQ [V]): BOOLEAN new_cursor: ITERATION_CURSOR [V] out: STRING_8 out_degree_count (v: V): INTEGER_32 outgoing (v: V): REL [V, V] paths (v1, v2: V): SET [SEQ [V]] reachable (src: V): SEQ [V] shortest_path (v1, v2: V): detachable SEQ [V] shortest_path_via_dijkstra (v1, v2: V): detachable SEQ [V] topologically_sorted: SEQ [V] vertex_count: INTEGER_32 vertex_extended alias "+" (v: V): [like Current] COMPARABLE_GRAPH [V] vertex_removed alias "-" (v: V): [like Current] COMPARABLE_GRAPH [V] vertices: SET [V] vertices_edge_count: INTEGER_32 vertices_incoming_edge_count: INTEGER_32 vertices_outgoing_edge_count: INTEGER_32 Zero: INTEGER_64 Commands edge_extend (e: PAIR [V, V]) edge_remove (e: PAIR [V, V]) vertex_extend (v: V) vertex_remove (v: V)
Generated by ISE EiffelStudio