Close
Close window
ModularityMatrix - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

GraphTheory

ModularityMatrix

construct modularity matrix

Calling Sequence

ModularityMatrix(G, opts)

Parameters

G

-

graph

opts

-

(optional) one or more options as specified below

Options

datatype=type

Specifies a datatype for the generated Matrix as described in rtable . The default is datatype=anything.

order=one of C_order or Fortran_order

Specifies the order of the generated Matrix. The default is order=C_order.

shape=name or list of names

Specifies the storage allocation for Matrix entries. Must be a name or list of names specifying one or more built-in or user-defined indexing functions . The default is shape=symmetric if G is undirected and shape=[] if G is directed.

Description

ModularityMatrix(G) returns the modularity matrix of a graph G.

The default output is an n by n Matrix with the following properties:

By default datatype=anything and order=C_order

If G is undirected, by default shape=symmetric

If G is directed, by default shape=[]

Definition

Let G be a graph and let m be its number of edges. The modularity matrix of G is defined as follows:

If G is undirected, the entry i,j of this matrix is deg[i]*deg[j]/2/m where deg[i] is the degree of vertex i.

If G is directed, the entry i,j of this matrix is indeg[i]*outdeg[j]/m where indeg[i] is the in-degree of vertex i and outdeg[j] is the out-degree of vertex j.

Examples

>

withGraphTheory:

>

GGraph1,2,3,4,Trail1,2,3,4,1

GGraph 1: an undirected graph with 4 vertices and 4 edges

(1)
>

ModularityMatrixG

12121212121212121212121212121212

(2)

Compatibility

The GraphTheory[ModularityMatrix] command was introduced in Maple 2025.

For more information on Maple 2025 changes, see Updates in Maple 2025 .


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /