Graphviz
2.41.20171026.1811
Main Page
Data Structures
Files
File List
Globals
lib
sparse
clustering.h
Go to the documentation of this file.
1
/* $Id$Revision: */
2
/* vim:set shiftwidth=4 ts=8: */
3
4
/*************************************************************************
5
* Copyright (c) 2011 AT&T Intellectual Property
6
* All rights reserved. This program and the accompanying materials
7
* are made available under the terms of the Eclipse Public License v1.0
8
* which accompanies this distribution, and is available at
9
* http://www.eclipse.org/legal/epl-v10.html
10
*
11
* Contributors: See CVS logs. Details at http://www.graphviz.org/
12
*************************************************************************/
13
14
#ifndef CLUSTERING_H
15
#define CLUSTERING_H
16
17
typedef
struct
Multilevel_Modularity_Clustering_struct
*
Multilevel_Modularity_Clustering
;
18
19
struct
Multilevel_Modularity_Clustering_struct
{
20
int
level
;
/* 0, 1, ... */
21
int
n
;
22
SparseMatrix
A
;
/* n x n matrix */
23
SparseMatrix
P
;
24
SparseMatrix
R
;
25
Multilevel_Modularity_Clustering
next
;
26
Multilevel_Modularity_Clustering
prev
;
27
int
delete_top_level_A
;
28
int
*
matching
;
/* dimension n. matching[i] is the clustering assignment of node i */
29
real
modularity
;
30
real
deg_total
;
/* total edge weights, including self-edges */
31
real
*
deg
;
/* dimension n. deg[i] equal to the sum of edge weights connected to vertex i. I.e., sum of row i */
32
int
agglomerate_regardless
;
/* whether to agglomerate nodes even if this causes modularity reduction. This is used if we want to force
33
agglomeration so as to get less clusters
34
*/
35
36
37
};
38
39
enum
{
CLUSTERING_MODULARITY
= 0,
CLUSTERING_MQ
};
40
41
/* find a clustering of vertices by maximize modularity
42
A: symmetric square matrix n x n. If real value, value will be used as edges weights, otherwise edge weights are considered as 1.
43
inplace: whether A can e modified. If true, A will be modified by removing diagonal.
44
45
maxcluster: used to specify the maximum number of cluster desired, e.g., maxcluster=10 means that a maximum of 10 clusters
46
. is desired. this may not always be realized, and modularity may be low when this is specified. Default: maxcluster = 0 (no limit)
47
48
use_value: whether to use the entry value, or treat edge weights as 1.
49
nclusters: on output the number of clusters
50
assignment: dimension n. Node i is assigned to cluster "assignment[i]". 0 <= assignment < nclusters.
51
. If *assignment = NULL on entry, it will be allocated. Otherwise used.
52
modularity: achieve modularity
53
*/
54
void
modularity_clustering
(
SparseMatrix
A,
int
inplace,
int
maxcluster,
int
use_value,
55
int
*nclusters,
int
**assignment,
real
*modularity,
int
*flag);
56
57
#endif
Multilevel_Modularity_Clustering_struct::next
Multilevel_Modularity_Clustering next
Definition:
clustering.h:25
Multilevel_Modularity_Clustering_struct::agglomerate_regardless
int agglomerate_regardless
Definition:
clustering.h:32
modularity_clustering
void modularity_clustering(SparseMatrix A, int inplace, int ncluster_target, int use_value, int *nclusters, int **assignment, real *modularity, int *flag)
Definition:
clustering.c:350
Multilevel_Modularity_Clustering_struct::modularity
real modularity
Definition:
clustering.h:29
CLUSTERING_MODULARITY
Definition:
clustering.h:39
Multilevel_Modularity_Clustering_struct::delete_top_level_A
int delete_top_level_A
Definition:
clustering.h:27
Multilevel_Modularity_Clustering_struct::matching
int * matching
Definition:
clustering.h:28
CLUSTERING_MQ
Definition:
clustering.h:39
Multilevel_Modularity_Clustering
struct Multilevel_Modularity_Clustering_struct * Multilevel_Modularity_Clustering
Definition:
clustering.h:17
Multilevel_Modularity_Clustering_struct::deg_total
real deg_total
Definition:
clustering.h:30
Multilevel_Modularity_Clustering_struct::level
int level
Definition:
clustering.h:20
Multilevel_Modularity_Clustering_struct::prev
Multilevel_Modularity_Clustering prev
Definition:
clustering.h:26
Multilevel_Modularity_Clustering_struct::A
SparseMatrix A
Definition:
clustering.h:22
SparseMatrix_struct
Definition:
SparseMatrix.h:26
Multilevel_Modularity_Clustering_struct::P
SparseMatrix P
Definition:
clustering.h:23
Multilevel_Modularity_Clustering_struct::n
int n
Definition:
clustering.h:21
Multilevel_Modularity_Clustering_struct
Definition:
clustering.h:19
Multilevel_Modularity_Clustering_struct::deg
real * deg
Definition:
clustering.h:31
Multilevel_Modularity_Clustering_struct::R
SparseMatrix R
Definition:
clustering.h:24
real
#define real
Definition:
general.h:34
Generated by
1.8.5