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
60924bc5
Commit
60924bc5
authored
Mar 21, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix merge
parent
9941ec91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
FLouvain.hs
src/Data/Graph/Clustering/FLouvain.hs
+3
-10
No files found.
src/Data/Graph/Clustering/FLouvain.hs
View file @
60924bc5
...
...
@@ -132,7 +132,6 @@ step (p, v, l, s) cgr = cgr
where
mNc
=
nodeCommunity
v
cgr
ncs
=
nodeNeighbours
v
cgr
-- We move node from community nc into ncs
moves
::
Maybe
(
LNode
Community
,
[
LNode
Community
])
moves
=
case
mNc
of
...
...
@@ -172,14 +171,14 @@ nodeCommunity n cgr = head (filter f $ labNodes cgr)
nodeNeighbours
::
Node
->
CGr
->
[
LNode
Community
]
nodeNeighbours
n
cgr
=
case
nodeCommunity
n
cgr
of
Nothing
->
[]
Nothing
->
[]
Just
(
cn
,
_
)
->
mapMaybe
(
lnode
cgr
)
(
neighbors
cgr
cn
)
-- | Find 'Ajd CGrEdge's of 'Community' graph neighbouring a given node
nodeLNeighbours
::
Node
->
CGr
->
Adj
CGrEdge
nodeLNeighbours
n
cgr
=
case
nodeCommunity
n
cgr
of
Nothing
->
[]
Nothing
->
[]
Just
(
cn
,
_
)
->
lneighbors
cgr
cn
-- | Moves 'Node' in the 'Direction' of 'Community' and recomputes 'Community''s weights
...
...
@@ -194,19 +193,13 @@ moveNodeWithNeighbours :: Adj (FEdge b) -> Node -> Direction -> Community -> Com
moveNodeWithNeighbours
lnNeighbors
n
direction
(
Community
(
ns
,
inwsum
,
totwsum
))
=
Community
(
newNs
,
newInWsum
,
newTotWsum
)
where
newNs
::
[
Node
]
newNs
=
case
direction
of
Into
->
n
:
ns
OutOf
->
DL
.
delete
n
ns
(
newInWsum
,
newTotWsum
)
=
computeWeights
direction
(
inwsum
,
totwsum
)
sumN
sumNonCom
directionN
::
Double
directionN
=
case
direction
of
Into
->
1
OutOf
->
-
1
-- Update InWeightSum with connections between node and the community
sumN
::
Double
sumN
=
sum
$
map
(
fedgeWeight
.
fst
)
comNeighbors
...
...
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