Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
clustering.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#pragma once
12
13#include <stdbool.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
20
22 int level;/* 0, 1, ... */
23 int n;
24 SparseMatrix A; /* n x n matrix */
29 int *matching; /* dimension n. matching[i] is the clustering assignment of node i */
30 double modularity;
31 double deg_total; /* total edge weights, including self-edges */
32 double *deg;/* dimension n. deg[i] equal to the sum of edge weights connected to vertex i. I.e., sum of row i */
37};
38
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 nclusters: on output the number of clusters
49 assignment: dimension n. Node i is assigned to cluster "assignment[i]". 0 <= assignment < nclusters.
50 . If *assignment = NULL on entry, it will be allocated. Otherwise used.
51 modularity: achieve modularity
52*/
53void modularity_clustering(SparseMatrix A, bool inplace, int maxcluster,
54 int *nclusters, int **assignment, double *modularity);
55
56#ifdef __cplusplus
57}
58#endif
struct Multilevel_Modularity_Clustering_struct * Multilevel_Modularity_Clustering
Definition clustering.h:19
void modularity_clustering(SparseMatrix A, bool inplace, int maxcluster, int *nclusters, int **assignment, double *modularity)
Definition clustering.c:342
@ CLUSTERING_MODULARITY
Definition clustering.h:39
@ CLUSTERING_MQ
Definition clustering.h:39
#define A(n, t)
Definition expr.h:76
Multilevel_Modularity_Clustering prev
Definition clustering.h:27
Multilevel_Modularity_Clustering next
Definition clustering.h:26