Macaulay2 » Documentation
Packages » Chordal :: treewidth
next | previous | forward | backward | up | index | toc

treewidth -- treewidth of a graph

Synopsis

Description

This method computes the treewidth of a chordal graph.

i1 : G = graph(toList(0..9),{
         {0,{6,7}},{1,{4,9}},{2,{3,5}},{3,{7,8}},
         {4,{5,8}},{5,{8}},{6,{8,9}},{7,{8}},{8,{9}} });
i2 : Gc = chordalGraph G

o2 = ChordalGraph{0 => {6, 7}    }
                  1 => {4, 9}
                  2 => {3, 5}
                  3 => {5, 7, 8}
                  4 => {5, 8, 9}
                  5 => {7, 8, 9}
                  6 => {7, 8, 9}
                  7 => {8, 9}
                  8 => {9}
                  9 => {}

o2 : ChordalGraph
i3 : treewidth Gc

o3 = 3

      

Ways to use treewidth :

For the programmer

The object treewidth is a method function.