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
ba86adac
Commit
ba86adac
authored
Mar 23, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Path] dir && undir (to test)
parent
bca1ac4b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
14 deletions
+30
-14
ILouvain.hs
src/Data/Graph/Clustering/ILouvain.hs
+30
-14
No files found.
src/Data/Graph/Clustering/ILouvain.hs
View file @
ba86adac
...
@@ -38,24 +38,40 @@ data RGraph = Empty | Gr RGraph Double
...
@@ -38,24 +38,40 @@ data RGraph = Empty | Gr RGraph Double
-- |
-- |
-- 5
-- 5
ns
::
[
LNode
RGraph
]
spoon
::
Gr
RGraph
Double
ns
=
zip
[
1
..
6
]
(
cycle
[
Empty
])
spoon
=
mkGraph
ns
es
where
ns
::
[
LNode
RGraph
]
ns
=
zip
[
1
..
6
]
(
cycle
[
Empty
])
es
::
[
LEdge
Double
]
es
::
[
LEdge
Double
]
es
=
[
(
1
,
2
,
1.0
)
es
=
[
(
1
,
2
,
1.0
)
,
(
1
,
3
,
1.0
)
,
(
1
,
3
,
1.0
)
,
(
2
,
4
,
1.0
)
,
(
2
,
4
,
1.0
)
,
(
3
,
4
,
1.0
)
,
(
3
,
4
,
1.0
)
,
(
4
,
5
,
1.0
)
,
(
4
,
5
,
1.0
)
]
]
------------------------------------------------------------------------
-- Paths in the Graph to be tested
-- Directed graph strategy
path_dir
::
Graph
gr
=>
gr
a
b
->
[[
Node
]]
path_dir
g
=
map
(
\
xs
->
dfs
xs
g
)
(
components
g
)
spoon
::
Gr
RGraph
Double
-- UnDirected graph strategy
spoon
=
mkGraph
ns
es
path
::
(
DynGraph
gr
,
Eq
b
)
=>
gr
a
b
->
[[
Node
]]
path
g'
=
map
sortNodes
cs
where
sortNodes
ns
=
case
head
$
sortOn
(
Down
.
(
deg
g
))
ns
of
Nothing
->
[]
Just
n
->
dfs
[
n
]
g
-- dfs for glustering, bfs for klustering
cs
=
components
g
g
=
undir
g'
------------------------------------------------------------------------
------------------------------------------------------------------------
-- Path in the Graph
path
::
Graph
gr
=>
gr
a
b
->
[[
Node
]]
path
g
=
map
(
\
xs
->
dfs
xs
g
)
(
components
g
)
------------------------------------------------------------------------
------------------------------------------------------------------------
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