Commit a20e2ec7 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[TEST] hLouvain

parent 5993a1f3
......@@ -38,11 +38,11 @@ type Community = [Node]
type Reverse = Bool
------------------------------------------------------------------------
iLouvain :: I.MaxIterations
iLouvainMap :: I.MaxIterations
-> I.MaxSize
-> Map (Node, Node) Double
-> [LouvainNode]
iLouvain x s m = concat
iLouvainMap 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')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment