class GRAPH [V -> attached ANY] General cluster: mathmodels description: "Mathematical model for a Directed Graph = (vertices, edges) where vertices is a set of vertices in generic parameter V, and edges is a relation in vertices: vertices: SET [V] edges: REL [V, V] Has 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 a sequence of vertices that may be ordered in descendants such as COMPARABLE_GRAPH[G]. Derived queries such as: reachable (src: V): SEQ[V] shortest_path(v1, v2: V): detachable SEQ[V] is_a_shortest_path (v1, v2: V; seq: SEQ[V]): BOOLEAN cycle (v: V): detachable SEQ[V] is_acyclic: BOOLEAN topologically_sorted: SEQ[V] is_topologically_sorted (seq: SEQ[V]): BOOLEAN 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." create: make_empty, make_from_tuple_array Ancestors DEBUG_OUTPUT* ITERABLE* [G] 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] GRAPH [V] edge_removed alias "|\" (e: PAIR [V, V]): [like Current] 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] GRAPH [V]): BOOLEAN is_reachable (v1, v2: V): BOOLEAN is_subgraph alias "|<:" (other: [like Current] 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] GRAPH [V] vertex_removed alias "-" (v: V): [like Current] 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) Constraints empty consistency valid edge ends valid edge ends consistency incoming outgoing consistency incoming outgoing2 count property symmetry 1 count property symmetry 2 self loops are incomng and outgoing
Generated by ISE EiffelStudio