3. Ongelmanratkonta haun avulla. Eero Hyvönen Helsingin yliopisto

Samankaltaiset tiedostot
4 Heuristinen haku. Eero Hyvönen Helsingin yliopisto

Capacity Utilization

Kognitiivinen mallintaminen 1

The CCR Model and Production Correspondence

16. Allocation Models

Bounds on non-surjective cellular automata

Eero Hyvönen Helsingin yliopisto

Tietorakenteet ja algoritmit

5. Rajoitelaskenta (Constraint Satisfaction)

Operatioanalyysi 2011, Harjoitus 4, viikko 40

Returns to Scale II. S ysteemianalyysin. Laboratorio. Esitelmä 8 Timo Salminen. Teknillinen korkeakoulu

On instrument costs in decentralized macroeconomic decision making (Helsingin Kauppakorkeakoulun julkaisuja ; D-31)

On instrument costs in decentralized macroeconomic decision making (Helsingin Kauppakorkeakoulun julkaisuja ; D-31)

Rationaalinen agentti. Kognitiivinen mallintaminen I. Rationaalinen agentti. Rationaalinen agentti. Kognitiivinen mallintaminen I, kevät /1/08

Efficiency change over time

1.3Lohkorakenne muodostetaan käyttämällä a) puolipistettä b) aaltosulkeita c) BEGIN ja END lausekkeita d) sisennystä

1. SIT. The handler and dog stop with the dog sitting at heel. When the dog is sitting, the handler cues the dog to heel forward.

Operatioanalyysi 2011, Harjoitus 2, viikko 38

Alternative DEA Models

LYTH-CONS CONSISTENCY TRANSMITTER

Gap-filling methods for CH 4 data

anna minun kertoa let me tell you

National Building Code of Finland, Part D1, Building Water Supply and Sewerage Systems, Regulations and guidelines 2007

A TIETORAKENTEET JA ALGORITMIT

1.3 Lohkorakenne muodostetaan käyttämällä a) puolipistettä b) aaltosulkeita c) BEGIN ja END lausekkeita d) sisennystä

Uusi Ajatus Löytyy Luonnosta 4 (käsikirja) (Finnish Edition)

Information on preparing Presentation

Other approaches to restrict multipliers

Mat Seminar on Optimization. Data Envelopment Analysis. Economies of Scope S ysteemianalyysin. Laboratorio. Teknillinen korkeakoulu

Capacity utilization

Kognitiivinen mallintaminen I

C++11 seminaari, kevät Johannes Koskinen

Returns to Scale Chapters

Ajettavat luokat: SM: S1 (25 aika-ajon nopeinta)

Results on the new polydrug use questions in the Finnish TDI data

1.1 Pino (stack) Koodiluonnos. Graafinen esitys ...

The Viking Battle - Part Version: Finnish

On instrument costs in decentralized macroeconomic decision making (Helsingin Kauppakorkeakoulun julkaisuja ; D-31)

Toppila/Kivistö Vastaa kaikkin neljään tehtävään, jotka kukin arvostellaan asteikolla 0-6 pistettä.

Käyttöliittymät II. Käyttöliittymät I Kertaus peruskurssilta. Keskeisin kälikurssilla opittu asia?

SIMULINK S-funktiot. SIMULINK S-funktiot

Travel Getting Around

JOHDATUS TEKOÄLYYN TEEMU ROOS

Miksi Suomi on Suomi (Finnish Edition)

KMTK lentoestetyöpaja - Osa 2

Laatu yritystoiminnan ytimessä. Junnu Lukkari

Luovuudesta muutama lisäys insinöörin työkalupakkiin

TM ETRS-TM35FIN-ETRS89 WTG

21~--~--~r--1~~--~--~~r--1~

Operatioanalyysi 2011, Harjoitus 3, viikko 39

Se mistä tilasta aloitetaan, merkitään tyhjästä tulevalla nuolella. Yllä olevassa esimerkissä aloitustila on A.

You can check above like this: Start->Control Panel->Programs->find if Microsoft Lync or Microsoft Lync Attendeed is listed

( ( OX2 Perkkiö. Rakennuskanta. Varjostus. 9 x N131 x HH145

TM ETRS-TM35FIN-ETRS89 WTG

Alueellinen yhteistoiminta

Tynnyrivaara, OX2 Tuulivoimahanke. ( Layout 9 x N131 x HH145. Rakennukset Asuinrakennus Lomarakennus 9 x N131 x HH145 Varjostus 1 h/a 8 h/a 20 h/a

Luovuudesta muutama lisäys insinöörin työkalupakkiin. Prof. Katja Hölttä Otto

T : Max-flow / min-cut -ongelmat

Huom. tämä kulma on yhtä suuri kuin ohjauskulman muutos. lasketaan ajoneuvon keskipisteen ympyräkaaren jänteen pituus

Metsälamminkankaan tuulivoimapuiston osayleiskaava

TM ETRS-TM35FIN-ETRS89 WTG

Lataa Cognitive Function in Opioid Substitution Treated Patiens - Pekka Rapeli. Lataa

( ,5 1 1,5 2 km

S SÄHKÖTEKNIIKKA JA ELEKTRONIIKKA

Alternatives to the DFT

BDD (behavior-driven development) suunnittelumenetelmän käyttö open source projektissa, case: SpecFlow/.NET.

Co-Design Yhteissuunnittelu

Information on Finnish Language Courses Spring Semester 2018 Päivi Paukku & Jenni Laine Centre for Language and Communication Studies

Ongelma 1: Ovatko kaikki tehtävät/ongelmat deterministisiä?

TM ETRS-TM35FIN-ETRS89 WTG

TM ETRS-TM35FIN-ETRS89 WTG

KONEISTUSKOKOONPANON TEKEMINEN NX10-YMPÄRISTÖSSÄ

TM ETRS-TM35FIN-ETRS89 WTG

Rekisteröiminen - FAQ

Sisävesidirektiivin soveltamisala poikkeussäännökset. Versio: puheenjohtajan ehdotus , neuvoston asiakirja 8780/16.

VAASAN YLIOPISTO Humanististen tieteiden kandidaatin tutkinto / Filosofian maisterin tutkinto

4x4cup Rastikuvien tulkinta

812336A C++ -kielen perusteet,

TM ETRS-TM35FIN-ETRS89 WTG

TM ETRS-TM35FIN-ETRS89 WTG

Network to Get Work. Tehtäviä opiskelijoille Assignments for students.

Ohjelmoinnin peruskurssien laaja oppimäärä

TM ETRS-TM35FIN-ETRS89 WTG

WindPRO version joulu 2012 Printed/Page :42 / 1. SHADOW - Main Result

2_1----~--~r--1.~--~--~--,.~~

,0 Yes ,0 120, ,8

Harjoitus 4 ( )

JOHDATUS TEKOÄLYYN TEEMU ROOS

EUROOPAN PARLAMENTTI

Tutkimusdata ja julkaiseminen Suomen Akatemian ja EU:n H2020 projekteissa

Use of Stochastic Compromise Programming to develop forest management alternatives for ecosystem services

Vertaispalaute. Vertaispalaute, /9

Choose Finland-Helsinki Valitse Finland-Helsinki

Nuku hyvin, pieni susi -????????????,?????????????????. Kaksikielinen satukirja (suomi - venäjä) ( (Finnish Edition)

7. Product-line architectures

FinFamily PostgreSQL installation ( ) FinFamily PostgreSQL

Mallintarkastus. Mallin generointi. Esimerkki mallin SMV-kuvauksesta. Tila-avaruuden symbolinen esitys (I)

Information on Finnish Language Courses Spring Semester 2017 Jenni Laine

Topologies on pseudoinnite paths

make and make and make ThinkMath 2017

Transkriptio:

3. Ongelmanratkonta haun avulla Eero Hyvönen Helsingin yliopisto

Haku Tavoiteperustaisilla agenteilla Tavoitteen (goal( goal) ) saavuttaminen Ongelman muotoilu (sopivalla yleisyystasolla) Esim. maailma on joukko tiloja uto eri kaupungeissa Toimenpiteillä voidaan siirtyä tilasta toiseen jetaan kaupungista toiseen Tavoitteen muotoilu (kriteeri) Esim. perillä tietyssä kaupungissa Tekoäly, Eero Hyvönen, 2004 2

Haun input: ongelman kuvaus tila-avaruutena avaruutena Haun output (ongelman ratkaisu): toimenpidejono alkutilasta tavoitetilaan Ongelman näin n ratkettua voidaan ratkaisu suorittaa (execution( execution) Esim. lähdetl hdetään n ajamaan kaupungista toiseen Tekoäly, Eero Hyvönen, 2004 3

Hyvin määm ääritelty tila-avaruus avaruus ongelma ja sen ratkaisu lkutila (initial( state) Esim. ollaan kaupungissa rad Tavoitetila (goal( state) Esim. ollaan ukarestissa Seuraajafunktio (successor( function) S-fn(state) -> > {<action, state>} Tila-avaruus avaruus (state( space) Määräytyy alkutilasta ja seuraajafunktiosta Esim. Romanian kartta Polku (path( path) Peräkk kkäisten toimenpiteiden muodostama tilojen jono Tavoitetesti (goal( test) Ratkaisu (solution( solution) Polku alkutilasta tavoitetilaan Toimenpiteen/polun kustannus (cost( cost) Esim. kaupunkien välinen v ajomatka Optimiratkaisu Ratkaisu, jonka kustannus on pienin Tekoäly, Eero Hyvönen, 2004 4

Tekoäly, Eero Hyvönen, 2004 5

Oletuksena yksinkertainen ympärist ristö ympärist ristön n staattisuus havaittavuus ympärist ristön diskreettisyys deterministisyys toimenpiteet suoritetaan jääj ääräpäisesti silmät ummessa toimintaa ei esim. arvioida uudelleen muuttuneessa tilanteessa Tekoäly, Eero Hyvönen, 2004 6

Tekoäly, Eero Hyvönen, 2004 7

Tekoäly, Eero Hyvönen, 2004 8

Tekoäly, Eero Hyvönen, 2004 9

Tekoäly, Eero Hyvönen, 2004 10

Tekoäly, Eero Hyvönen, 2004 11

Tekoäly, Eero Hyvönen, 2004 12

Tekoäly, Eero Hyvönen, 2004 13

24-puzzle (5x5 ruudukko): 10^25 tilaa, on jo vaikea ratkaista optimaalisesti Tekoäly, Eero Hyvönen, 2004 14

Reaalimaailman ongelmatyyppejä Route-finding Esim. lennot Navigointi Touring Esim. traveling salesperson VLSI design ssembly (kokoaminen) ioinformatiikka Esim. proteiinien laskostuminen Tekoäly, Eero Hyvönen, 2004 15

Hakupuu Haun tilan esitysmuoto Haussa hakusolmu (vast. tilaa) lavennetaan (expand)) vastaten siirtymistä seuraaviin tiloihin Jos lavennettu solmu vastaa lopputilaa, haku päättyy, muuten solmuja lavennetaan edelleen Hakustrategia määm äärää,, missä järjestyksessä edetää ään Hakupuu tila-avaruus avaruus Hakusolmu on haun kirjanpidollinen esityselementti Tekoäly, Eero Hyvönen, 2004 16

Tekoäly, Eero Hyvönen, 2004 17

Tekoäly, Eero Hyvönen, 2004 18

Tekoäly, Eero Hyvönen, 2004 19

Tekoäly, Eero Hyvönen, 2004 20

Tekoäly, Eero Hyvönen, 2004 21

Search strategies strategy is defined by picking the order of node expansion Strategies are evaluated along the following dimensions: completeness does it always find a solution if one exists? time complexity number of nodes generated/expanded space complexity maximum number of nodes in memory optimality does it always find a least-cost solution? Time and space complexity are measured in terms of b maximum branching factor of the search tree d depth of the least-cost solution m maximum depth of the state space (may be ) hapter 3 31

Uninformed search strategies Uninformed strategies use only the information available in the problem definition readth-first search Uniform-cost search Depth-first search Depth-limited search Iterative deepening search hapter 3 32

Expand shallowest unexpanded node readth-first search Implementation: fringe is a FIFO queue, i.e., new successors go at end hapter 3 33

Expand shallowest unexpanded node readth-first search Implementation: fringe is a FIFO queue, i.e., new successors go at end hapter 3 34

Expand shallowest unexpanded node readth-first search Implementation: fringe is a FIFO queue, i.e., new successors go at end hapter 3 35

Expand shallowest unexpanded node readth-first search Implementation: fringe is a FIFO queue, i.e., new successors go at end hapter 3 36

Properties of breadth-first search omplete?? hapter 3 37

Properties of breadth-first search omplete?? Yes (if b is finite) Time?? hapter 3 38

Properties of breadth-first search omplete?? Yes (if b is finite) Time?? 1 + b + b 2 + b 3 +... + b d + b(b d 1) = O(b d+1 ), i.e., exp. in d Space?? hapter 3 39

Properties of breadth-first search omplete?? Yes (if b is finite) Time?? 1 + b + b 2 + b 3 +... + b d + b(b d 1) = O(b d+1 ), i.e., exp. in d Space?? O(b d+1 ) (keeps every node in memory) Optimal?? hapter 3 40

Properties of breadth-first search omplete?? Yes (if b is finite) Time?? 1 + b + b 2 + b 3 +... + b d + b(b d 1) = O(b d+1 ), i.e., exp. in d Space?? O(b d+1 ) (keeps every node in memory) Optimal?? Yes (if cost = 1 per step); not optimal in general Space is the big problem; can easily generate nodes at 100M/sec so 24hrs = 8640G. hapter 3 41

Muistisyöppö reath-first Search b=10, 10.000 solmu/s, 1k solmu d Solmut ika Muisti 2 1100 0.11s 1M 6 10^7 19min 10G 10 10^11 12pv 10P

Expand least-cost unexpanded node Uniform-cost search Implementation: fringe = queue ordered by path cost, lowest first Equivalent to breadth-first if step costs all equal omplete?? Yes, if step cost ɛ Time?? # of nodes with g cost of optimal solution, O(b /ɛ ) where is the cost of the optimal solution Space?? # of nodes with g cost of optimal solution, O(b /ɛ ) Optimal?? Yes nodes expanded in increasing order of g(n) hapter 3 42

Expand deepest unexpanded node Depth-first search Implementation: fringe = LIFO queue, i.e., put successors at front H I J K L M N O hapter 3 43

Expand deepest unexpanded node Depth-first search Implementation: fringe = LIFO queue, i.e., put successors at front H I J K L M N O hapter 3 44

Expand deepest unexpanded node Depth-first search Implementation: fringe = LIFO queue, i.e., put successors at front H I J K L M N O hapter 3 45

Expand deepest unexpanded node Depth-first search Implementation: fringe = LIFO queue, i.e., put successors at front H I J K L M N O hapter 3 46

Expand deepest unexpanded node Depth-first search Implementation: fringe = LIFO queue, i.e., put successors at front H I J K L M N O hapter 3 47

Expand deepest unexpanded node Depth-first search Implementation: fringe = LIFO queue, i.e., put successors at front H I J K L M N O hapter 3 48

Expand deepest unexpanded node Depth-first search Implementation: fringe = LIFO queue, i.e., put successors at front H I J K L M N O hapter 3 49

Expand deepest unexpanded node Depth-first search Implementation: fringe = LIFO queue, i.e., put successors at front H I J K L M N O hapter 3 50

Expand deepest unexpanded node Depth-first search Implementation: fringe = LIFO queue, i.e., put successors at front H I J K L M N O hapter 3 51

Expand deepest unexpanded node Depth-first search Implementation: fringe = LIFO queue, i.e., put successors at front H I J K L M N O hapter 3 52

Expand deepest unexpanded node Depth-first search Implementation: fringe = LIFO queue, i.e., put successors at front H I J K L M N O hapter 3 53

Expand deepest unexpanded node Depth-first search Implementation: fringe = LIFO queue, i.e., put successors at front H I J K L M N O hapter 3 54

Properties of depth-first search omplete?? hapter 3 55

Properties of depth-first search omplete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces Time?? hapter 3 56

Properties of depth-first search omplete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces Time?? O(b m ): terrible if m is much larger than d but if solutions are dense, may be much faster than breadth-first Space?? hapter 3 57

Properties of depth-first search omplete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces Time?? O(b m ): terrible if m is much larger than d but if solutions are dense, may be much faster than breadth-first Space?? O(bm), i.e., linear space! Optimal?? hapter 3 58

Properties of depth-first search omplete?? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces Time?? O(b m ): terrible if m is much larger than d but if solutions are dense, may be much faster than breadth-first Space?? O(bm), i.e., linear space! Optimal?? No hapter 3 59

Depth-limited search = depth-first search with depth limit l, i.e., nodes at depth l have no successors Recursive implementation: function Depth-Limited-Search( problem, limit) returns soln/fail/cutoff Recursive-DLS(Make-Node(Initial-State[problem]), problem, limit) function Recursive-DLS(node, problem, limit) returns soln/fail/cutoff cutoff-occurred? false if Goal-Test(problem, State[node]) then return node else if Depth[node] = limit then return cutoff else for each successor in Expand(node, problem) do result Recursive-DLS(successor, problem, limit) if result = cutoff then cutoff-occurred? true else if result failure then return result if cutoff-occurred? then return cutoff else return failure hapter 3 60

Iterative deepening search function Iterative-Deepening-Search( problem) returns a solution inputs: problem, a problem for depth 0 to do result Depth-Limited-Search( problem, depth) if result cutoff then return result end hapter 3 61

Iterative deepening search l = 0 Limit = 0 hapter 3 62

Iterative deepening search l = 1 Limit = 1 hapter 3 63

Iterative deepening search l = 2 Limit = 2 hapter 3 64

Iterative deepening search l = 3 Limit = 3 H I J K L M N O H I J K L M N O H I J K L M N O H I J K L M N O H I J K L M N O H I J K L M N O H I J K L M N O H I J K L M N O H I J K L M N O H I J K L M N O H I J K L M N O H I J K L M N O hapter 3 65

omplete?? Properties of iterative deepening search hapter 3 66

Properties of iterative deepening search omplete?? Yes Time?? hapter 3 67

Properties of iterative deepening search omplete?? Yes Time?? (d + 1)b 0 + db 1 + (d 1)b 2 +... + b d = O(b d ) Space?? hapter 3 68

Properties of iterative deepening search omplete?? Yes Time?? (d + 1)b 0 + db 1 + (d 1)b 2 +... + b d = O(b d ) Space?? O(bd) Optimal?? hapter 3 69

Properties of iterative deepening search omplete?? Yes Time?? (d + 1)b 0 + db 1 + (d 1)b 2 +... + b d = O(b d ) Space?? O(bd) Optimal?? Yes, if step cost = 1 an be modified to explore uniform-cost tree Numerical comparison for b = 10 and d = 5, solution at far right leaf: N(IDS) = 50 + 400 + 3, 000 + 20, 000 + 100, 000 = 123, 450 N(FS) = 10 + 100 + 1, 000 + 10, 000 + 100, 000 + 999, 990 = 1, 111, 100 IDS does better because other nodes at depth d are not expanded FS can be modified to apply goal test when a node is generated hapter 3 70

Summary of algorithms riterion readth- Uniform- Depth- Depth- Iterative First ost First Limited Deepening omplete? Yes Yes No Yes, if l d Yes Time b d+1 b /ɛ b m b l b d Space b d+1 b /ɛ bm bl bd Optimal? Yes Yes No No Yes hapter 3 71

Repeated states Failure to detect repeated states can turn a linear problem into an exponential one! D hapter 3 72

Graph search function Graph-Search( problem, fringe) returns a solution, or failure closed an empty set fringe Insert(Make-Node(Initial-State[problem]), fringe) loop do if fringe is empty then return failure node Remove-Front(fringe) if Goal-Test(problem, State[node]) then return node if State[node] is not in closed then add State[node] to closed fringe Insertll(Expand(node, problem), fringe) end hapter 3 73

Verkkohaku = puuhaku, joka muistaa aiemmin tutkimansa solmut eikä toista lavennuksia Idea: ei tehdä samaa työtä useaan kertaan Verkkohaku voi olla paljon tehokkaampi kuin puuhaku Tilakompeksisuus kasvaa suljetun listan muistamisen takia Optimaalisuus riippuu käytetystk ytetystä strategiasta Optimiratkaisu voidaan hylätä toistoa vältettv ltettäessä

Haku epätäsm smällisellä tiedolla Sensorless / conformant problems gentti ei tiedä missä tilassa se on (voi olla useassa) Vaihtoehtoiset skenaariot Tila-avaruuden avaruuden uskomustiloina (belief( state) ) tilojen joukot ontingency problems Havainnot ympärist ristöstä tai toimenpiteiden vaikutus epätäsm smällisiä Vaihtoehtoiset skenaariot Hakua laajennetaan havaintoon perustavalla ehdollisella toimenpiteell teellä Toiminnan kokeilun ja haun yhdistelmä Esim. käveleminen k kadulla maitokauppaan dversal problems ontingency problem,, jossa epätäsm smällisyys on toisen agentin aiheuttamaa Exploration problems Tiloja ja toimenpiteiden vaikutuksia ei tunneta vaan ne pitää tutkia Ääritapaus contingency-ongelmista ongelmista Tekoäly, Eero Hyvönen, 2004 28

Summary Problem formulation usually requires abstracting away real-world details to define a state space that can feasibly be explored Variety of uninformed search strategies Iterative deepening search uses only linear space and not much more time than other uninformed algorithms Graph search can be exponentially more efficient than tree search hapter 3 74

Lähteet S. Russell,, P. Norvig: rtificial Intelligence, a Modern pproach. Prentice-Hall Hall,, 2003. S. Russell,, Tekoälykurssin kalvot erkleyn yliopistossa, 2004. Tekoäly, Eero Hyvönen, 2004 29