Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is.triangulated

Decide if a graph is triangulated


Description

Decide if a graph is triangulated

Usage

is.triangulated(g)

Arguments

g

an instance of the graph class

Details

An undirected graph G = (V, E) is triangulated (i.e. chordal) if all cycles [v1, v2, ..., vk] of length 4 or more have a chord, i.e., an edge [vi, vj] with j != i +/- 1 (mod k)

An equivalent definition of chordal graphs is:

G is chordal iff either G is an empty graph, or there is an v in V such that

  1. the neighborhood of v (i.e., v and its adjacent nodes) forms a clique, and

  2. recursively, G-v is chordal

Value

The return value is TRUE if g is triangulated and FALSE otherwise. An error is thrown if the graph is not undirected; you might use ugraph to compute the underlying graph.

Author(s)

Li Long <li.long@isb-sib.ch>

References

Combinatorial Optimization: algorithms and complexity (p. 403) by C. H. Papadimitriou, K. Steiglitz

Examples

con1 <- file(system.file("XML/conn.gxl",package="RBGL"), open="r")
coex <- fromGXL(con1)
close(con1)

is.triangulated(coex)

con2 <- file(system.file("XML/hcs.gxl",package="RBGL"), open="r")
coex <- fromGXL(con2)
close(con2)

is.triangulated(coex)

RBGL

An interface to the BOOST graph library

v1.66.0
Artistic-2.0
Authors
Vince Carey <stvjc@channing.harvard.edu>, Li Long <li.long@isb-sib.ch>, R. Gentleman
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.