Upload
iris-ramsey
View
214
Download
2
Embed Size (px)
Citation preview
An Efficient Algorithm
for the Computation of Optimum Paths
in Weighted Graphs
Radu Iosif, Marius Bozga, Vassiliki Sfyrla
Univ. de Grenoble ’’Joseph Fourier’’ & VERIMAG
MEMICS 2007 October 2007 Znojmo(CZ)
Verimag
• Leading research center in embedded systems
• Contributes in synchronous languages, verification, testing and modelling
Verimag
• Leading research center in embedded systems
• Contributes in synchronous languages, verification, testing and modelling
VerificationVerification
’’Are we building the product right? ’’ or
’’Does the product conform to the specifications? ’’
Verification using counter automata
Counter automata represents an important class of infinite-state systems
used for verification of protocols, software, etc…
Flat counter automata are a subclass of counter automata
without nested loops
reachability and termination are decidable
In particular, reachability problem of flat counter automata is related to finding the optimal path of given length in weighted graphs [CJ’98, BIL’06]
x=x+1A B C D
x=x+1
y=y+2
x=0
Y=0
[x>y]
Description of the problem (1)
Weighted Directed Graph G(V,E,w)
Vertices V := {A,B,C,D,E}
Edges E := {AB, BC, CD, DE, …}
integer weight w := {w(AB)=1, w(BC)=2,… }
Description of the problem (2)
Which is the weight of the optimal path from the node A to the node E
in 1 step ?
in 2 steps ?
in 3 steps ?
…
in n steps ?
stepsnofpathoptimalexistsEvertextoAvertexfromwweightand
nwAEX
Description of the problem (3)
Length Paths OptimalPath
Weight
1 -
Description of the problem
Length Paths OptimalPath
Weight
1 -
2 -
Description of the problem (3)
Description of the problem
,...35AEX
Length Paths OptimalPath
Weight
1 -
2 -
3 ACDE ACDE 5
Description of the problem (3)
,...46,3
5AEX
Length Paths OptimalPath
Weight
1 -
2 -
3 ACDE ACDE 5
4 ABCDEACCDE
ABCDE 6
Description of the problem
Description of the problem (3)
,...58,4
6,35AEX
Length Paths OptimalPath
Weight
1 -
2 -
3 ACDE ACDE 5
4 ABCDEACCDE
ABCDE 6
5ABACDEACDCDEACCCDE
ACDCDE 8
Description of the problem
Description of the problem (3)
Length Paths OptimalPath
Weight
1 -
2 -
3 ACDE ACDE 5
4 ABCDEACCDE
ABCDE 6
5ABACDEACDCDEACCCDE
ACDCDE 8
…
n w
,...,...,58,4
6,35
nwAEX
Description of the problemDescription of the problem (3)
mmkkAEX 23
46
23
35
Known Solution
The set can be expressed using Presburger arithmetic
This method is general but costly
• the size of the formula is linear to the size of the graph
• there are no efficient methods to simplify it
AEX
Our approach (1)
finds simultaneously all sets as the least fixpoint solution of the following system of equations:
AEADACABAA XXXXX ,,,,
Definitions:
wwAandAA
BABA
mw
mw
mw
nw
nw
nnww
,min
, 2
2
1
1
21
21
12
11
12
12
12
12
11
00
13
min
min
min
min
min
ADAE
ACAD
ABADACAAAC
AAAB
AAABAA
XX
XX
XXXXX
XX
XandXX
Our approach (2)
• Solving the system of equations iteratively
termination is not guaranteed
presence of loops in the weighted graph
=> accelerate, consider an augmented system, where loops are taken into account at every step:
ΝΝ
Ν
Ν
Ν
12
23
23
24
24
12
11
12
12
12
12
11
13
min
min
min
min
min
ADAE
ACAD
ABADACAAAC
AAAB
ABAA
XX
XX
XXXXX
XX
XX
However, ’’optimal ratio loops’’ are enough to ensure termination
in principle, much fewer than « all » loops
12
11
12
12
12
12
11
13
min
min
min
min
min
ADAE
ACAD
ABADACAAAC
AAAB
ABAA
XX
XX
XXXXX
XX
XX
Ν
Ν
Ν
Ν
23
23
24
24
Our approach (2)
• Solving the system of equations iteratively
termination is not guaranteed
presence of loops in the weighted graph
=> accelerate, consider an augmented system, where loops are taken into account at every step:
Implementation
Represent sets as semilinear sets on :
where
Finding optimal ratio loops
• using the Howard Algorithm[TCGG’98]
Implementing the min operator
using rewriting rules on semilinear sets
AEADACABAA XXXXX ,,,, 2
k
k
nw
nw
nw ...1
1
0
0
wwAAA mw
mw
mw ,&min
kk wwwandnnn ,...,,,...,, 1010
Conclusions
We introduce an innovative solution for the computation of the weight of the optimal paths of given length in weighted graphs
The results provide a technique for the analysis of flat counter automata
The method has been implemented in Java and the results are very satisfying (to be released soon)