• No results found

MuACOsm A New Mutation-Based Ant Colony Optimization Algorithm for Learning Finite-State Machines

N/A
N/A
Protected

Academic year: 2021

Share "MuACOsm A New Mutation-Based Ant Colony Optimization Algorithm for Learning Finite-State Machines"

Copied!
43
0
0

Loading.... (view fulltext now)

Full text

(1)

MuACOsm – A New Mutation-Based Ant Colony Optimization Algorithm for Learning Finite-State Machines

Daniil Chivilikhin and Vladimir Ulyantsev

National Research University of IT, Mechanics and Optics St. Petersburg, Russia

Evolutionary and Combinatorial Optimization Track @ GECCO 2013

(2)

Motivation: Reliable software

• Systems with high cost of failure

– Energy industry – Aircraft industry – Space industry – …

• We want to have reliable software

– Testing is not enough – Verification is needed

(3)

Introduction (1)

• Automated software engineering

• Model-driven development

• Automata-based programming

Software

specification Model Code

(4)

Introduction (2)

Software

specification Model Code

Finite-state

machine

(5)

Finite-State Machine

• S – set of states

• s0 ∈ S – initial state

• Σ – set of input events

• Δ – set of output actions

• δ: S×Σ→S – transition function

• λ: S×Σ→Δ – actions function Example:

• two states

• events = {A, T}

• actions = {z1, z2, z3, z4}

2

A/z2 T/z1

1

A/z3 T/z3

(6)

Automated-controlled object

Finite-state machine

Controlled object Actions

Events

Automata-based programming

Design programs with complex behavior as automated-controlled objects

e1

e2

z1

z3

Events Output

actions

z2 z4 z2

(7)

Automata-based programming:

advantages

• Model before programming code, not vice versa

• Possibility of program verification using Model Checking

• You can check temporal properties (LTL)

Model Code

Finite-state machine

(8)

Issues

• Hard to build an FSM with desired structure and behavior

• Several problems of learning FSMs were proven to be NP-hard

• One of the solutions – metaheuristics

(9)

Software specification

Test examples

Modeling environment

Fitness function

Learning finite-state machines with metaheuristics

• Nstates – number of states

• Σ – input events

• Δ – output actions

• X = (Nstates, Σ, Δ) – search space

(10)

Approaches to learning FSMs

• Greedy heuristics

– problem-specific

• Reduction to SAT and CSP problems

– fast

– problem-specific

• Evolutionary algorithms (general)

– slow

(11)

Proposed approach

• Based on Ant Colony Optimization (ACO)

• Non-standard problem reduction

• Modified ACO algorithm

(12)

Solution representation

Transition table Output table

δ Event λ Event

State A T State A T

1 1 2 1 z1 z2

(13)

“Canonical” way to apply ACO

• Reduce problem to finding a minimum cost path in some complete graph

• Vertices – FSM transitions:

– <i ∈ S, j ∈ S, e ∈ Σ, a ∈ Δ>

• Each ant adds transitions to its FSM

1→1 [T/z1] 1→2 [A/z2]

(14)

“Canonical” ACO: example

• 2 states

• 2 events

• 1 action

(15)

“Canonical” ACO: issues

• Number of vertices in the construction graph grows as (N

states

)

2

×|Σ|×|Δ|

• No meaningful way to define heuristic information

• Later we show that “canonical” ACO is

ineffective for FSM learning

(16)

Proposed algorithm: MuACOsm

• Mutation-Based ACO for learning FSMs

• Uses a non-standard problem reduction

• Modified ACO

(17)

Problem reduction: MuACOsm vs. “canonical”

• “Canonical” ACO

– Nodes are solution components – Full solutions are built by ants

• Proposed MuACOsm algorithm

– Nodes are full solutions (FSMs) – Ants travel between full solutions

(18)

FSM Mutations

2

A/z2

T/z1 1 A/z3

T/z3

2

T/z1

1

A/z1

T/z3

2

T/z1

1

A/z3

T/z3 Change

transition action

Change transition end state

(19)

MuACOsm problem reduction

• Construction graph

– nodes are FSMs

– edges are mutations of FSMs

• Example

(20)

Real search space graph

(21)

Part of real search space (1)

(22)

Part of real search space (2)

(23)

Heuristic information

u η

uv

= max(η

min

, f(v) – f(u)) v

(24)

ACO algorithm

A

0

= random FSM

Improve A

0

with (1+1)-ES Graph = {A

0

}

while not stop() do

ConstructAntSolutions

UpdatePheromoneValues

DaemonActions

(25)

Constructing ant solutions

• Use a colony of ants

• An ant is placed on a graph node

• Each ant has a limited number of steps

• On each step the ant

moves to the next node

A

A4

A3

A2

A1

(26)

Ant step: selecting the next node

Go to best mutated

Probabilistic selection

P = Pnew

P = 1 – Pnew

u v u v

p

A f(A)=10

А4 f(A4)=9

A3

f(A3)=0 A2

f(A2)=12 A1 f(A1)=8

Mutation

A

A4 A3 A2 A1

(27)

Pheromone update

• Ant path quality = max fitness value on a path

• Update – largest pheromone value deployed on edge (u, v)

• Update pheromone values:

– pheromone evaporation rate

best

τ

uv

best uv uv

uv

= ρ τ + τ

τ ( 1  )

  0,1

ρ

(28)

Differences from previous work

• Added heuristic information

• Changed start node selection for ants

• Coupling with (1+1)-ES

• More experiments (later)

• More comparisons with other authors

• Harder problem

(29)

“Simple” problem: Artificial Ant

• Toroidal field N×N

• M pieces of food

• smax time steps

• Fixed position of food and the ant

• Goal – build an FSM,

such that the ant will eat all food in K steps

(30)

Artificial Ant: Fitness function

max last food max

1 s

s n s

f    

• n

food

– number of eaten food pieces

• s

max

– max number of allotted steps

• s

last

– number of used steps

f

eaten food

used time steps

(31)

“Simple” problem: Artificial Ant

• Two fields:

– Santa Fe Trail – John Muir Trail

• Comparison:

– “Canonical” ACO

– Christensen et al. (2007) – Tsarev et al. (2007)

– Chellapilla et al. (1999)

Santa Fe Trail

(32)

“Canonical” ACO

“Canonical”

ACO

MuACOsm State

count

Success rate, %

Success rate, %

5 18 87

10 10 91

(33)

Santa Fe Trail (Christensen et al., 600 steps)

5000 7000 9000 11000 13000 15000 17000 19000 21000

Fitness evaluation count

MuACOsm Christensen et al

(34)

John Muir Trail (Tsarev et al., 2007): 200 steps

0 5 10 15 20 25 30 35 40 45 50

8 9 10 11 12 13 14 15 16

Fitneess evaluation count

×106 MuACOsm Genetic algorithm

(35)

“Harder” problem: learning Extended

Finite-State Machines (1)

(36)

Input data:

• Number of states C and sets Σ and Δ

• Set of test examples T

• T

i

=<input sequence I

j,

output sequence

O

j

>

NP-hard problem: build an EFSM with C states compliant with tests T

“Harder” problem: learning Extended Finite-State Machines (2)

ACO for Learning FSMs 36

(37)

Learning EFSMs: Fitness function

• Pass inputs to EFSM, record outputs

• Compare generated outputs with references

• Fitness = string similarity measure (edit

distance)

(38)

Experimental setup

1. Generate random EFSM with C states

2. Generate set of tests of total length C×150 3. Learn EFSM

4. Experiment for each C repeated 100 times 5. Run until perfect fitness

6. Record mean number of fitness evaluations

(39)

Learning random EFSMs

(40)

Conclusion

• Developed new ACO-based algorithm for learning FSMs and EFSMs

• MuACOsm greatly outperforms GA on considered problems

• Generated programs can be verified with

Model Checking

(41)

Future work

• Better FSM representation to deal with isomorphism

• Use novelty search

• Employ verification in learning process

Fitness Function

Model

MuACOsm

(42)

Acknowledgements

• We thank the ACM for the student travel

grants

(43)

Thank you for your attention!

Daniil Chivililikhin Vladimir Ulyantsev

This presentation online:

http://rain.ifmo.ru/~chivdan/papers/2013/

MuACOsm – A New Mutation-Based Ant Colony Optimization Algorithm for Learning Finite-State Machines

[email protected]

References

Related documents

I n the months of April-July virtually all of seven states in the region (Alabama, Georgia, Kentucky, North and South Carolina, Tennessee, and Virginia) experienced

The effect of the coarsening of the grid has been compared with fine grid and the results are visualized in the form of different grid figure, further coarsened grid refined on

This note is an overview of recent results on open beauty and quarkonium production and polarisation from the ATLAS [1], CMS [2] and LHCb [3] collaborations.. 2 Open

The main findings of this study can be summarized as follows. 1) Using a general screening questionnaire, no seasonal pattern in the severity of depressive and anxiety symptoms

Contraceptive use, prevalence and predictors of pregnancy planning among female sex workers in Uganda a cross sectional study RESEARCH ARTICLE Open Access Contraceptive use, prevalence

For the binary vari- able (failure of jaundice resolution), if missing data were reported in original studies, we would perform best-worst scenario (assuming that participants with

EURASIP Journal on Applied Signal Processing 2004 12, 1912?1920 c? 2004 Hindawi Publishing Corporation Algorithms for Hardware Based Pattern Recognition Volker Lohweg Koenig & Bauer AG

We hypothesize that the worsening air quality may likely impact common systemic inflammatory processes, thus driving communicable and non-communicable diseases alike.Receptor