<< maxplusaplus Max-Plus Algebra maxplusctv >>

Max-Plus Algebra >> Max-Plus Algebra > maxplusccir

maxplusccir

Max-plus algebra critical circuit

Calling Sequence

[l,d,x] = maxplusccir(A)

Parameters

A
: square input matrix
l
: scalar denotes maximum cycle mean
d
: a constan denotes the length of critical circuit
x
: output a row vector denotes critical circuit

Description

This function returns x, that is the critical circuit of G(A) and the maximum cycle mean of graph G(A) denoted by l. And error if this maximum cycle mean does not exist. This mean that at least there are two entries of cycle time vector of A have different values. If x = [ x1 x2 x3 ⋯ xn ] then the critical circuit of the graph G(A) is xn → xn-1→ xn-2→ ⋯ → x1→ xn . Let the element xi is dinoted by i with 1≤ i ≤n. Then [a(1,2)+a(2,3)+⋯ +a(n-1,n)+a(n,1)] / d = l.

Examples

A  = [2.  -%inf    8.    2.    9.;
      6.  -%inf  -%inf   8.    8.;
      8.  -%inf    6.    1.    5.;
      0.    2.     5.    3.   10.;
      7.    4.  -%inf  -%inf   6.] 

[l,d,x] = maxplusccir(A)
 x  =
 
    1.    3.  
 d  =
 
    2.  
 l  =
 
    8
// We can check (A(1,3)+A(3,1))/2 = 8.
(A(1,3)+A(3,1))/2
 ans  =
 
    8.  

// The next example returns error(maximum cycle mean does not exist).
A=[1 -%inf;2 9]
 A  =
 
    1.  -Inf  
    2.    9.  
[l,d,x] = maxplusccir(A)
 !--error 10000 
The matrix does not has a unique eigenvalue
at line      32 of function called by :  
line     3 of function called by :  
[l,d,x] = maxplusccir(A)
 
// Check the cycle time vector has different entries
 v=maxplusctv(A)
 v  =
 
    1.  
    9.

Author

"Max-Plus Algebra Toolbox", ver. 1.01, April, 2009.

See Also


<< maxplusaplus Max-Plus Algebra maxplusctv >>