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
68dbd445
Commit
68dbd445
authored
Mar 22, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ILouvain] RGraph definition.
parent
60924bc5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
1 deletion
+60
-1
clustering-louvain.cabal
clustering-louvain.cabal
+2
-1
ILouvain.hs
src/Data/Graph/Clustering/ILouvain.hs
+58
-0
No files found.
clustering-louvain.cabal
View file @
68dbd445
...
@@ -4,7 +4,7 @@ cabal-version: 1.12
...
@@ -4,7 +4,7 @@ cabal-version: 1.12
--
--
-- see: https://github.com/sol/hpack
-- see: https://github.com/sol/hpack
--
--
-- hash:
0eb2bbc80a3d9343540c4d5c0c2ff6adee085a9a75364b8f5344890891c5b781
-- hash:
9d2b00c4d3d099b31d6b9db84cd1172e0464481bc132080e2694e02b5587b29b
name: clustering-louvain
name: clustering-louvain
version: 0.1.0.0
version: 0.1.0.0
...
@@ -42,5 +42,6 @@ library
...
@@ -42,5 +42,6 @@ library
Data.Graph.Clustering.Example
Data.Graph.Clustering.Example
Data.Graph.Clustering.FLouvain
Data.Graph.Clustering.FLouvain
Data.Graph.Clustering.HLouvain
Data.Graph.Clustering.HLouvain
Data.Graph.Clustering.ILouvain
Paths_clustering_louvain
Paths_clustering_louvain
default-language: Haskell2010
default-language: Haskell2010
src/Data/Graph/Clustering/ILouvain.hs
0 → 100644
View file @
68dbd445
{-|
Module : Data.Graph.Clustering.ILouvain
Description : Purely functional (Inductive) Louvain clustering
Copyright : (c) Alexandre Delanoë, CNRS, 2020-Present
License : AGPL + CECILL v3
Maintainer : alexandre.delanoe+louvain@iscpif.fr
Stability : experimental
Portability : POSIX
ILouvain: really inductive Graph
-}
{-# LANGUAGE ConstrainedClassMethods #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE NoImplicitPrelude #-}
module
Data.Graph.Clustering.ILouvain
where
import
Data.List
(
zip
,
cycle
)
import
Protolude
hiding
(
empty
)
import
Data.Graph.Inductive
------------------------------------------------------------------------
-- Recursive Graph
data
RGraph
=
Empty
|
Gr
[
RGraph
]
Double
deriving
(
Show
,
Eq
)
------------------------------------------------------------------------
-- Spoon Graph
-- 1
-- / \
-- 2 3
-- \ /
-- 4
-- |
-- 5
ns
::
[
LNode
RGraph
]
ns
=
zip
[
1
..
6
]
(
cycle
[
Empty
])
es
::
[
LEdge
Double
]
es
=
[
(
1
,
2
,
1.0
)
,
(
1
,
3
,
1.0
)
,
(
2
,
4
,
1.0
)
,
(
3
,
4
,
1.0
)
,
(
4
,
5
,
1.0
)
]
spoon
::
Gr
RGraph
Double
spoon
=
mkGraph
ns
es
------------------------------------------------------------------------
------------------------------------------------------------------------
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