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
36815247
Commit
36815247
authored
3 years ago
by
erwan
Browse files
Options
Downloads
Patches
Plain Diff
add support of init search in test/coloring
parent
2dbf4f75
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/coloring/config.ml
+11
-2
11 additions, 2 deletions
test/coloring/config.ml
test/coloring/p.ml
+5
-3
5 additions, 3 deletions
test/coloring/p.ml
test/coloring/state.ml
+1
-1
1 addition, 1 deletion
test/coloring/state.ml
with
17 additions
and
6 deletions
test/coloring/config.ml
+
11
−
2
View file @
36815247
...
...
@@ -12,5 +12,14 @@ let clash_number pidl get =
let
potential
=
Some
clash_number
(* let potential = None *)
let
legitimate
=
None
let
fault
=
None
let
init_search_utils
=
None
let
fault
=
None
let
md
=
max_degree
()
let
s2n
s
=
[
I
(
0
,
s
,
md
)]
let
n2s
nl
s
=
match
nl
with
|
[
I
(
_
,
i
,
_
)]
->
i
|
_
->
assert
false
let
init_search_utils
=
Some
(
s2n
,
n2s
)
This diff is collapsed.
Click to expand it.
test/coloring/p.ml
+
5
−
3
View file @
36815247
(* Time-stamp: <modified the
28/07
/2021 (at
09:01
) by Erwan Jahier> *)
(* Time-stamp: <modified the
12/10
/2021 (at
15:42
) by Erwan Jahier> *)
(* This is algo 3.1 in the book *)
open
Algo
let
k
=
if
is_directed
()
then
failwith
"this algo is for non-directed graphs!"
card
()
+
1
failwith
"this algo is for non-directed graphs!"
else
max_degree
()
+
1
...
...
@@ -12,7 +12,9 @@ let (init_state: int -> string -> 'v) = fun i _ -> Random.int i
let
(
colors
:
'
v
neighbor
list
->
'
v
list
)
=
fun
nl
->
List
.
map
(
fun
n
->
state
n
)
nl
(* Returns the free colors is ascending order (n.log(n)) *)
(* Returns the free colors is ascending order (n.log(n))
nb: suppose that all states are in [0;k-1]
*)
let
(
free
:
'
v
neighbor
list
->
'
v
list
)
=
fun
nl
->
let
comp_neg
x
y
=
-
(
compare
x
y
)
in
let
n_colors
=
List
.
map
(
fun
n
->
state
n
)
nl
in
(* neighbor colors *)
...
...
This diff is collapsed.
Click to expand it.
test/coloring/state.ml
+
1
−
1
View file @
36815247
...
...
@@ -4,7 +4,7 @@
type
t
=
int
let
to_string
=
Printf
.
sprintf
"c=%i"
let
of_string
=
Some
int_of_string
let
of_string
=
Some
(
fun
s
->
Scanf
.
sscanf
s
"c=%i"
(
fun
s
->
s
))
let
copy
=
fun
x
->
x
let
actions
=
[
"conflict"
]
...
...
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