Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs2-23wi
project06
Commits
7b52f3b6
Commit
7b52f3b6
authored
2 years ago
by
James C Bowden
Browse files
Options
Download
Email Patches
Plain Diff
add more wheel graph tests!
parent
0ec4c805
master
No related merge requests found
Pipeline
#78108
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/edu/caltech/cs2/project06/DSaturTests.java
+14
-6
tests/edu/caltech/cs2/project06/DSaturTests.java
with
14 additions
and
6 deletions
+14
-6
tests/edu/caltech/cs2/project06/DSaturTests.java
View file @
7b52f3b6
...
...
@@ -157,12 +157,14 @@ public class DSaturTests {
checkValidNColoring
(
g
,
K
);
}
@Test
@Tag
(
"B"
)
@DisplayName
(
"Test DSatur on wheel graph (guaranteed optimal)"
)
public
void
testWheel
()
{
int
K
=
6
;
NodeGraph
g
=
new
NodeGraph
(
K
+
1
);
@DisplayName
(
"Test DSatur on various wheel graphs (guaranteed optimal)"
)
@ParameterizedTest
(
name
=
"Test DSatur on wheel graph with {0} vertices"
)
@CsvSource
({
"6"
,
"7"
,
"8"
,
"9"
,
"10"
,
"25"
,
"100"
,
"501"
,
"1000"
})
public
void
testWheel
(
int
T
)
{
// K is number of outer vertices
int
K
=
T
-
1
;
NodeGraph
g
=
new
NodeGraph
(
T
);
for
(
int
i
=
0
;
i
<
K
+
1
;
i
++)
{
g
.
addEdge
(
i
%
K
,
(
i
+
1
)
%
K
);
}
...
...
@@ -171,7 +173,13 @@ public class DSaturTests {
}
DSatur
.
color
(
g
);
checkValidNColoring
(
g
,
3
);
int
maxColors
;
if
(
K
%
2
==
0
){
maxColors
=
3
;
}
else
{
maxColors
=
4
;
}
checkValidNColoring
(
g
,
maxColors
);
}
@Tag
(
"B"
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help