GraphTheory
TuttePolynomial
compute Tutte polynomial
ChromaticPolynomial
compute chromatic polynomial
FlowPolynomial
compute flow polynomial
RankPolynomial
compute rank polynomial
AcyclicPolynomial
compute acyclic polynomial
ReliabilityPolynomial
compute reliability polynomial
Calling Sequence
Parameters
Description
Examples
References
Compatibility
TuttePolynomial(H, x, y)
ChromaticPolynomial(G, t)
FlowPolynomial(G, x)
RankPolynomial(G, x, y)
AcyclicPolynomial(G, p)
ReliabilityPolynomial(H, p)
H
-
undirected graph
G
undirected unweighted graph
t,x,y,p
variables or values
The TuttePolynomial command returns a bivariate polynomial in x and y when x and y are variables or the evaluation of the bivariate polynomial when x or y are values.
The Tutte polynomial, T(G;x,y), is a generalization of the chromatic polynomial and is defined as follows:
If G has no edges then T(G;x,y) = 1.
Let e be any edge in G and let G-e and G/e denote the graph G with e removed and with e contracted, respectively.
If e is a loop then T(G;x,y) = y*T(G-e;x,y)
If e is a bridge (cut-edge) then T(G;x,y) = x*T(G/e;x,y)
If e is not a bridge nor a loop then T(G;x,y) = T(G-e;x,y) + T(G/e;x,y)
The ChromaticPolynomial, FlowPolynomial, RankPolynomial, and ReliabilityPolynomial are functions of the Tutte polynomial. They are all NP-hard to compute in general.
The ChromaticPolynomial command returns a polynomial, P(G,t), which is the number of proper vertex colorings of G using no more than t colors, where t is a non-negative integer.
The chromatic polynomial, P(G;t), for a graph G with n vertices, and k connected components, can be expressed in terms of the Tutte polynomial T(G;x,y), as follows:
P(G;t) = (-1)^(n-k)*t^k*T(G;1-t,0)
P(G,t) has been determined for certain classes of graphs. Fast codes for the special cases for the complete graph, its complement, trees and cycles have been included in the command.
FlowPolynomial and RankPolynomial
The FlowPolynomial command returns a polynomial in x when x is a variable or the evaluation of the polynomial when x is a value. The value of this polynomial at a positive integer k gives the number of nowhere-zero flows on G with edge labels chosen from the integers modulo k.
The flow polynomial, Q(G;x), for a graph G with n vertices, m edges, and k connected components, can be expressed in terms of the Tutte polynomial, T(G;x,y), as follows:
Q(G;x) = (-1)^(m-n+k)*T(G;0,1-x)
The RankPolynomial command returns a bivariate polynomial in x and y when x and y are variables or the evaluation of the polynomial when x or y are values.
S(G;x,y) = T(G;x+1,y+1) where S(G;x,y) is the rank polynomial of G.
AcyclicPolynomial and ReliabilityPolynomial
The AcyclicPolynomial command returns a polynomial in p when p is a variable or the evaluation of the polynomial when p is a value. The value of this polynomial at a value 0≤p≤1 gives the probability that G is acyclic when each edge operates with probability p.
The ReliabilityPolynomial command returns a polynomial in p when p is a variable or the evaluation of the polynomial when p is a value. The value of this polynomial at a value 0≤p≤1 gives the probability that G is connected when each edge fails with probability p. For example, if G is a tree on n vertices, then if any edge fails G will become disconnected. Hence the reliability polynomial for a tree is (1-p)^(n-1). It can be computed as follows.
If the graph G is not connected, then its reliability polynomial is 0.
If e is a loop in G then R(G;p) = R(G-e;p)
If e is a bridge (isthmus) then R(G;p) = (1-p)*T(G/e;p)
If e is not a bridge nor a loop then R(G;p) = p*R(G-e;p) + (1-p)*R(G/e;p)
If G has n vertices and m edges, the reliability polynomial R(G;p) is related to the Tutte polynomial T(G;x,y) as follows
R(G;p) = T(G;1,1/p)*p^(n-1)*(1-p)^(m-n+1)
Notes
The TuttePolynomial and ReliabilityPolynomial commands accept a weighted graph H as input. The edge weights must be positive integers and they are interpreted as multiple edges.
The computation of the Tutte polynomial is NP-hard. We compute the Tutte polynomial using edge deletion and contraction and we remember the Tutte polynomial for each connected subgraph computed. By processing edges in a canonical ordering this enables us to identify subgraphs already seen without using a general graph isomorphism test. See references [2] and [4] Monagan in the References section.
with⁡GraphTheory:
with⁡SpecialGraphs:
with⁡RandomGraphs:
G≔CompleteGraph⁡4
G≔Graph 1: an undirected graph with 4 vertices and 6 edge(s)
TuttePolynomial⁡G,x,y
x3+y3+3⁢x2+4⁢x⁢y+3⁢y2+2⁢x+2⁢y
TuttePolynomial⁡G,x,1
x3+3⁢x2+6⁢x+6
We can verify the recurrence relation
G≔PetersenGraph⁡
G≔Graph 2: an undirected graph with 10 vertices and 15 edge(s)
f≔TuttePolynomial⁡G,x,y
f≔x9+6⁢x8+21⁢x7+56⁢x6+12⁢x5⁢y+y6+114⁢x5+70⁢x4⁢y+30⁢x3⁢y2+15⁢x2⁢y3+10⁢x⁢y4+9⁢y5+170⁢x4+170⁢x3⁢y+105⁢x2⁢y2+65⁢x⁢y3+35⁢y4+180⁢x3+240⁢x2⁢y+171⁢x⁢y2+75⁢y3+120⁢x2+168⁢x⁢y+84⁢y2+36⁢x+36⁢y
e≔Edges⁡G1
e≔1,2
Gminuse≔DeleteEdge⁡G,e,inplace=false
Gminuse≔Graph 3: an undirected graph with 10 vertices and 14 edge(s)
Gcontracte≔Contract⁡G,e,inplace=false
Gcontracte≔Graph 4: an undirected graph with 9 vertices and 14 edge(s)
expand⁡f−TuttePolynomial⁡Gminuse,x,y+TuttePolynomial⁡Gcontracte,x,y
0
P≔ChromaticPolynomial⁡G,x
P≔x⁢x−1⁢x−2⁢x7−12⁢x6+67⁢x5−230⁢x4+529⁢x3−814⁢x2+775⁢x−352
This must be zero since the Petersen graph is not 2-colorable
eval⁡P,x=2
eval⁡P,x=3
120
expand⁡P−ChromaticPolynomial⁡Gminuse,x−ChromaticPolynomial⁡Gcontracte,x
K≔CompleteGraph⁡10
K≔Graph 5: an undirected graph with 10 vertices and 45 edge(s)
We can convince ourselves that this graph needs 10 colors and can be colored 10! ways with 10 colors
ChromaticPolynomial⁡K,t
t⁢t−1⁢t−2⁢t−3⁢t−4⁢t−5⁢t−6⁢t−7⁢t−8⁢t−9
ChromaticPolynomial⁡K,10−10!
ChromaticPolynomial⁡RandomTree⁡100,t
t⁢t−199
Q≔FlowPolynomial⁡G,x
Q≔x6−15⁢x5+95⁢x4−325⁢x3+624⁢x2−620⁢x+240
eval⁡Q,x=4
eval⁡Q,x=5
240
T≔TuttePolynomial⁡G,0,1−x
T≔x6−15⁢x5+95⁢x4−325⁢x3+624⁢x2−620⁢x+240
n≔NumberOfVertices⁡G
n≔10
m≔NumberOfEdges⁡G
m≔15
k≔nops⁡ConnectedComponents⁡G
k≔1
expand⁡Q−−1m−n+k⁢T
K4≔CompleteGraph⁡4
K4≔Graph 6: an undirected graph with 4 vertices and 6 edge(s)
S≔RankPolynomial⁡K4,x,y
S≔x3+y3+6⁢x2+4⁢x⁢y+6⁢y2+15⁢x+15⁢y+16
The number of subgraphs
eval⁡S,x=1,y=1
64
The number of acyclic subgraphs
eval⁡S,x=1,y=0
38
The number of subgraphs whose rank = rank(G)
eval⁡S,x=0,y=1
The number of maximum spanning forests
eval⁡S,x=0,y=0
16
ReliabilityPolynomial and AcyclicPolynomial
P≔Graph⁡1,2,2,3
P≔Graph 7: an undirected graph with 3 vertices and 2 edge(s)
R≔ReliabilityPolynomial⁡P,p
R≔1−p2
AcyclicPolynomial⁡P,p
1
The reliability of a connected network should increase if we add an edge. The difference Q-P below is positive for 0<p<1.
AddEdge⁡P,1,3
Graph 7: an undirected graph with 3 vertices and 3 edge(s)
Q≔ReliabilityPolynomial⁡P,p
Q≔2⁢p+1⁢1−p2
factor⁡Q−R
2⁢−1+p2⁢p
expand⁡AcyclicPolynomial⁡P,p
−p3+1
Multiple edges may be specified as edge weights.
G≔Graph⁡1,2,2,1,3,1,2,3,1
G≔Graph 8: an undirected weighted graph with 3 vertices and 3 edge(s)
ReliabilityPolynomial⁡G,p
2⁢p2+2⁢p+1⁢1−p2
The following graph represents the Arpanet, the early internet, in late 1970.
V≔MIT,LINCOLN,CASE,CMU,HARVARD,BBN,UCSB,UCLA,STANFORD,SRI,RAND,UTAH,SDC:
Arpanet≔Graph⁡V,Trail⁡UCSB,UCLA,RAND,SDC,UTAH,SRI,STANFORD,UCLA,SRI,UCSB,BBN,RAND,MIT,UTAH,Trail⁡MIT,LINCOLN,CASE,CMU,HARVARD,BBN,MIT
Arpanet≔Graph 9: an undirected graph with 13 vertices and 17 edge(s)
SetVertexPositions⁡Arpanet,1.0,1.0,0.9,1.2,0.5,1.1,0.6,0.8,1.0,0.6,1.0,0.8,−1.1,0.1,−0.8,0.3,−0.6,0.5,−0.8,0.7,−0.8,−0.1,−0.3,0.9,−0.5,0.2
DrawGraph⁡Arpanet
R≔ReliabilityPolynomial⁡Arpanet,p
R≔280⁢p5+310⁢p4+186⁢p3+63⁢p2+12⁢p+1⁢1−p12
Which edge (link) should we add to the Arpanet to improve the reliability the most? Let's try adding the edge from Stanford to CMU.
H≔AddEdge⁡Arpanet,CMU,STANFORD,inplace=false
H≔Graph 10: an undirected graph with 13 vertices and 18 edge(s)
S≔ReliabilityPolynomial⁡H,p
S≔976⁢p6+1118⁢p5+703⁢p4+276⁢p3+72⁢p2+12⁢p+1⁢1−p12
We can compare the reliability polynomials visually for 0≤p≤1 then compute the improvement by computing the area of the enclosed curves as an integral.
plot⁡R,S,p=0..1,color=blue,red
improvement≔int⁡S−R,p=0..1
improvement≔44387910581480
evalf⁡improvement
0.04194866881
[1] Bollobás, Béla. Modern Graph Theory. Graduate Texts in Mathematics, 184, Springer-Verlag, New York, 1998.
[2] Farr, Khatarinejad, Khodadad, and Monagan. A Graph Theory Package for Maple. Proceedings of the 2005 Maple Conference, Maplesoft, July 2005: 260-271.
[3] Haggard, Pearce, and Royle. "Computing Tutte Polynomials." TOMS. Vol. 37(24). (2010): 1-17.
[4] Monagan. "A new edge selection heuristic for computing Tutte polynomials." Proceedings of FPSAC 2012.
The GraphTheory[ReliabilityPolynomial] command was introduced in Maple 17.
For more information on Maple 17 changes, see Updates in Maple 17.
See Also
ChromaticNumber
Contract
IsAcyclic
IsVertexColorable
Download Help Document