Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-igraph
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-igraph
Commits
1fa83144
Commit
1fa83144
authored
2 years ago
by
Alfredo Di Napoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add correctness tests for community algos
parent
86ddc5ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
Algorithms.hs
tests/Test/Algorithms.hs
+17
-1
No files found.
tests/Test/Algorithms.hs
View file @
1fa83144
...
...
@@ -167,13 +167,29 @@ communityTest = testGroup "Community"
communityCorrectnessTests
::
TestTree
communityCorrectnessTests
=
testGroup
"Clustering"
[
testCase
"spinglass"
spinglassClustering
,
testCase
"leiden"
leidenClustering
,
testCase
"infomap"
infomapClustering
]
where
runAlgo
::
CommunityMethod
->
IO
[[
Int
]]
runAlgo
=
withSeed
1
.
findCommunity
testGraph
Nothing
Nothing
spinglassClustering
::
Assertion
spinglassClustering
=
do
clusters
<-
withSeed
1
$
findCommunity
testGraph
Nothing
Nothing
spinglass
clusters
<-
runAlgo
spinglass
clusters
@?=
[[
3
,
4
],
[
0
,
1
,
2
]]
leidenClustering
::
Assertion
leidenClustering
=
do
clusters
<-
runAlgo
leiden
clusters
@?=
[[
0
,
1
,
2
,
3
,
4
]]
infomapClustering
::
Assertion
infomapClustering
=
do
clusters
<-
runAlgo
infomap
clusters
@?=
[[
0
,
1
,
2
,
3
,
4
]]
testGraph
::
Graph
'U
()
()
testGraph
=
mkGraphUfromEdges
[(
0
,
1
),(
1
,
2
),(
2
,
0
),(
2
,
3
),(
3
,
4
),(
4
,
2
)]
...
...
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