getConfs {PottsUtils}R Documentation

Generate Configurations of a Graph

Description

Using recursive method to generate all possible configurations of a graph.

Usage

   getConfs(nvertex, ncolor)

Arguments

nvertex

number of vertices in a graph.

ncolor

number of colors each vertex can take.

Details

Suppose there are n vertices and each can take values from 1,2, \ldots, ncolor. This function generates all possible configurations. For example, if there are two vertices and each can be either 1 or 2, then the possible configurations are (1,1), (1,2), (2,1) and (2,2).

Value

A matrix of all possible configurations. Each column corresponds to one configuration.

Examples

  #Example 1: There are two vertices and each is either of
  #           color 1 or 2.
  getConfs(2,2)

[Package PottsUtils version 0.3-3 Index]