Skip to content
Snippets Groups Projects
Commit b0e6aa76 authored by erwan's avatar erwan
Browse files

Add in Topology.t a bool indicating if the graph is directed

parent 792cbed1
No related branches found
No related tags found
No related merge requests found
(* Time-stamp: <modified the 11/10/2019 (at 14:27) by Erwan Jahier> *)
(* Time-stamp: <modified the 17/10/2019 (at 20:39) by Erwan Jahier> *)
open Graph
open Graph.Dot_ast
......@@ -15,6 +15,7 @@ type t = {
nodes: node list;
succ: node_id -> (int option * node_id) list;
of_id: node_id -> node;
directed:bool
}
type node_info_t = (string, node) Hashtbl.t
......@@ -125,8 +126,9 @@ let (read: string -> t) = fun f ->
nodes = List.rev res;
succ = (fun str -> try Hashtbl.find node_succ str with Not_found -> []);
of_id = (fun str -> try Hashtbl.find node_info str with Not_found ->
failwith (str^ " unknown node id")
)
failwith (str^ " unknown node id")
);
directed = dot_file.digraph
}
let (to_adjency: t -> bool array array) =
......
(* Time-stamp: <modified the 14/10/2019 (at 16:59) by Erwan Jahier> *)
(* Time-stamp: <modified the 17/10/2019 (at 20:39) by Erwan Jahier> *)
type node_id = string
type node = {
......@@ -12,6 +12,7 @@ type t = {
nodes: node list;
succ: node_id -> (int option * node_id) list;
of_id: node_id -> node;
directed:bool
}
(** Parse a sasa dot file *)
......
graph grid4 {
graph [min_deg=2
mean_deg=3.
max_deg=4
is_connected=true
is_cyclic=true
is_tree=true
links_number=24]
p0 [algo="p.ml" init="0"]
p1 [algo="p.ml" init="17"]
p2 [algo="p.ml" init="18"]
p3 [algo="p.ml" init="19"]
p4 [algo="p.ml" init="17"]
p5 [algo="p.ml" init="18"]
p6 [algo="p.ml" init="19"]
p7 [algo="p.ml" init="20"]
p8 [algo="p.ml" init="18"]
p9 [algo="p.ml" init="19"]
p10 [algo="p.ml" init="20"]
p11 [algo="p.ml" init="21"]
p12 [algo="p.ml" init="19"]
p13 [algo="p.ml" init="20"]
p14 [algo="p.ml" init="21"]
p15 [algo="p.ml" init="22"]
p0 -- p1
p0 -- p4
p1 -- p2
p1 -- p5
p10 -- p11
p10 -- p14
p10 -- p6
p10 -- p9
p11 -- p15
p11 -- p7
p12 -- p13
p12 -- p8
p13 -- p14
p13 -- p9
p14 -- p15
p2 -- p3
p2 -- p6
p3 -- p7
p4 -- p5
p4 -- p8
p5 -- p6
p5 -- p9
p6 -- p7
p8 -- p9
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment