Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sasa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
verimag
synchrone
sasa
Commits
528298e3
Commit
528298e3
authored
3 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
gg: add an option to compute the graph diameter
parent
917a7891
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tools/gg/graphGen.ml
+7
-8
7 additions, 8 deletions
tools/gg/graphGen.ml
tools/gg/graphGen_arg.ml
+6
-0
6 additions, 0 deletions
tools/gg/graphGen_arg.ml
tools/gg/graphGen_arg.mli
+1
-0
1 addition, 0 deletions
tools/gg/graphGen_arg.mli
with
14 additions
and
8 deletions
tools/gg/graphGen.ml
+
7
−
8
View file @
528298e3
...
...
@@ -83,8 +83,8 @@ let compute_attr : (Topology.t -> string list -> (string * string) list) =
)
*)
let
all_attr
:
(
Topology
.
t
->
(
string
*
string
)
list
)
=
fun
g
->
let
all_attr
:
bool
->
(
Topology
.
t
->
(
string
*
string
)
list
)
=
fun
diameter
g
->
[
"min_deg"
,
string_of_int
(
match
!
min_max
with
|
None
->
(
...
...
@@ -137,13 +137,12 @@ let all_attr : (Topology.t -> (string * string) list) =
Printf
.
eprintf
"Computing the link_number...
\n
"
;
flush
stderr
;
Topology
.
get_nb_link
g
);
(*
"diameter", string_of_int (
]
@
(
if
not
diameter
then
[]
else
[
"diameter"
,
string_of_int
(
Printf
.
eprintf
"Computing the diameter...
\n
"
;
flush
stderr
;
Diameter.get g)
*)
]
Diameter
.
get
g
)
])
let
to_dot_string
:
(
Topology
.
t
->
string
->
(
string
*
string
)
list
->
string
)
=
...
...
@@ -279,7 +278,7 @@ let () = (
exit
2
|
Some
g
->
g
in
make_dot
g
t
.
outputFile
(
all_attr
g
);
make_dot
g
t
.
outputFile
(
all_attr
t
.
diameter
g
);
if
(
t
.
outputFile
<>
""
&&
not
t
.
silent
)
then
Printf
.
printf
"Done.
\n
Output file : '%s'
\n
"
t
.
outputFile
)
This diff is collapsed.
Click to expand it.
tools/gg/graphGen_arg.ml
+
6
−
0
View file @
528298e3
...
...
@@ -35,6 +35,7 @@ type t = {
mutable
silent
:
bool
;
mutable
connected
:
bool
;
mutable
directed
:
bool
;
mutable
diameter
:
bool
;
mutable
_args
:
(
string
*
Arg
.
spec
*
string
)
list
;
mutable
_man
:
(
string
*
(
string
list
*
action
)
list
)
list
;
...
...
@@ -86,6 +87,7 @@ let (make_args : unit -> t) =
silent
=
false
;
connected
=
false
;
directed
=
false
;
diameter
=
false
;
_args
=
[]
;
_man
=
[]
;
...
...
@@ -299,6 +301,10 @@ let (mkoptab : string array -> t -> unit) =
(
Arg
.
Unit
(
fun
()
->
args
.
connected
<-
true
))
[([
"Try again until a connected graph is generated"
]
,
"void"
)];
mkopt
args
[
"--diameter"
]
(
Arg
.
Unit
(
fun
()
->
args
.
diameter
<-
true
))
[([
"Compute the graph diameter and put it in the graph attributes"
]
,
"void"
)];
mkopt
args
[
"--directed"
;
"-dir"
]
(
Arg
.
Unit
(
fun
()
->
match
args
.
action
with
|
"ring"
->
args
.
directed
<-
true
...
...
This diff is collapsed.
Click to expand it.
tools/gg/graphGen_arg.mli
+
1
−
0
View file @
528298e3
...
...
@@ -33,6 +33,7 @@ type t = {
mutable
silent
:
bool
;
mutable
connected
:
bool
;
mutable
directed
:
bool
;
mutable
diameter
:
bool
;
mutable
_args
:
(
string
*
Arg
.
spec
*
string
)
list
;
mutable
_man
:
(
string
*
(
string
list
*
action
)
list
)
list
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment