generic
type Vertex_Name_Type is (<> );
with function Name(Element : Element_Type) return Vertex_Name_Type;
package Graph.Undirected is
type Undirected_Graph_Type is new Graph_Type with private;
procedure Destroy
(Graph : in out Undirected_Graph_Type);
function Number_Of_Vertex
(Graph : in Undirected_Graph_Type) return Natural;
procedure Insert_Vertex
(Graph : in out Undirected_Graph_Type;
Element : in Element_Type);
procedure Insert_Arc
(Graph : in out Undirected_Graph_Type;
Init : in Element_Type;
Term : in Element_Type;
Weight : in Integer);
procedure Delete_Vertex
(Graph : in out Undirected_Graph_Type;
Element : in Element_Type);
procedure Delete_Arc
(Graph : in out Undirected_Graph_Type;
Init : in Element_Type;
Term : in Element_Type);
procedure Find_Vertex
(Graph : in Undirected_Graph_Type;
Element : in out Element_Type;
Match : out Boolean);
function Weight
(Graph : in Undirected_Graph_Type;
Init : in Element_Type;
Term : in Element_Type) return Integer;
procedure Find_Adjacent
(Graph : in Undirected_Graph_Type;
Element : in Element_Type;
Rank : in Natural;
Adjacent : out Element_Type;
Match : out Boolean);
private
type Matrix_Type is array (Vertex_Name_Type, Vertex_Name_Type) of Integer;
type Vertex_Type is
record
Element : Element_Type;
Found : Boolean := False;
end record;
type Vector_Type is array (Vertex_Name_Type) of Vertex_Type;
type Undirected_Graph_Type is new Graph_Type with
record
N : Natural := 0;
Arcs : Matrix_Type;
Vertexies : Vector_Type;
end record;
end Graph.Undirected;