Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clustering-louvain
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
0
Merge Requests
0
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
clustering-louvain
Commits
a20e2ec7
Commit
a20e2ec7
authored
Mar 30, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TEST] hLouvain
parent
5993a1f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
Louvain.hs
src/Data/Graph/Clustering/Louvain.hs
+9
-4
No files found.
src/Data/Graph/Clustering/Louvain.hs
View file @
a20e2ec7
...
...
@@ -38,11 +38,11 @@ type Community = [Node]
type
Reverse
=
Bool
------------------------------------------------------------------------
iLouvain
::
I
.
MaxIterations
iLouvain
Map
::
I
.
MaxIterations
->
I
.
MaxSize
->
Map
(
Node
,
Node
)
Double
->
[
LouvainNode
]
iLouvain
x
s
m
=
concat
iLouvain
Map
x
s
m
=
concat
$
toLouvainNode
$
I
.
toNodes
$
I
.
iLouvain
x
s
I
.
DfsNodes
g
...
...
@@ -55,11 +55,16 @@ flouvain n g = map (comNodes . snd) $ labNodes g'
where
g'
=
louvainFirstStepIterate
n
(
toFGraph
g
)
------------------------------------------------------------------------
hLouvain
::
(
Eq
b
,
DynGraph
gr
)
hLouvain
::
Map
(
Node
,
Node
)
Double
->
[
LouvainNode
]
hLouvain
m
=
hLouvain'
False
$
undir
$
map2graph
m
hLouvain'
::
(
Eq
b
,
DynGraph
gr
)
=>
Reverse
->
gr
a
b
->
[
LouvainNode
]
hLouvain
r
g
=
concat
$
toLouvainNode
(
bestpartition
r
g
)
hLouvain
'
r
g
=
concat
$
toLouvainNode
(
bestpartition
r
g
)
toLouvainNode
::
[[
Node
]]
->
[[
LouvainNode
]]
toLouvainNode
ns
=
zipWith
(
\
cId
ns'
->
map
(
\
n
->
LouvainNode
n
cId
)
ns'
)
...
...
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