kool, geit en wolf algoritmiek, NP-compleet en een beetje latijn Leidsche Flesch Lunsch-lezing Hendrik Jan Hoogeboom

Vergelijkbare documenten
Eindige. Automaten. zie dictaatje 4.2 ch.12 Languages, Automata, Grammars 12.5 finite state automata. Dertiende college

Eindige. Automaten. zie dictaat ch.12 Languages, Automata, Grammars 12.5 finite state automata

Twaalfde college complexiteit. 7 mei NP-volledigheid IV Cook-Levin Savitch 1

NP-Volledigheid. Wil zo snel mogelijke algoritmes om problemen op te lossen. De looptijd is polynomiaal: O n k - dat is heel erg mooi

waar is hier de uitgang?

Uitwerking van opgaven in Sipser

Stelling. SAT is NP-compleet.

Preschool Kindergarten

1 Inleiding. 2 Oplossing

NP-volledigheid. Algoritmiek

(On)Doenlijke problemen

Derde college algoritmiek. 23 februari Complexiteit Toestand-actie-ruimte

Taaltechnologie. Januari/februari Inhoud

Derde college algoritmiek. 16/17 februari Toestand-actie-ruimte

TW2020 Optimalisering

SAMPLE 11 = + 11 = + + Exploring Combinations of Ten + + = = + + = + = = + = = 11. Step Up. Step Ahead

Derde college algoritmiek. 18 februari Toestand-actie-ruimte

z x 1 x 2 x 3 x 4 s 1 s 2 s 3 rij rij rij rij

Fundamentele Informatica

Boolean Constraint Satisfaction Problems or: When does Post s Lattice Help?

Introductie in flowcharts

Derde college algoritmiek. 22 februari Complexiteit Toestand-actie-ruimte

SOLVING SET PARTITIONING PROBLEMS USING LAGRANGIAN RELAXATION

Derde college algoritmiek. 23 februari Toestand-actie-ruimte

ALGORITMIEK: answers exercise class 7

Elfde college complexiteit. 23 april NP-volledigheid III

Tentamen IN3105 Complexiteitstheorie

Engels op Niveau A2 Workshops Woordkennis 1

The genesis of the game is unclear. Possibly, dominoes originates from China and the stones were brought here by Marco Polo, but this is uncertain.

Tentamen IN3105. Complexiteitstheorie. 16 april 2012, uur

8+ 60 MIN Alleen te spelen in combinatie met het RIFUGIO basisspel. Only to be played in combination with the RIFUGIO basicgame.

Ius Commune Training Programme Amsterdam Masterclass 15 June 2018

Tentamen TI3300 / IN3105 Complexiteitstheorie

Tentamen combinatorische optimalisatie Tijd:

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

Meetkunde en Lineaire Algebra

2019 SUNEXCHANGE USER GUIDE LAST UPDATED

Hoofdstuk 17: Approximation Algorithms

Assignment. Example. is surrounded by exactly 3 coloured cells.

The first line of the input contains an integer $t \in \mathbb{n}$. This is followed by $t$ lines of text. This text consists of:

MyDHL+ Van Non-Corporate naar Corporate

Negende college complexiteit. 9 april NP-volledigheid I: introductie

Fundamentele. Informatica 1. Rechenmaschine (1623) von Wilhelm Schickard ( ), gebaut für seinen Freund Johannes Kepler

Onderwerpen Fundamentele Informatica IN 3120

Meetkunde en Lineaire Algebra

Golden 50 - Specials

Travel Survey Questionnaires

9 daagse Mindful-leSs 3 stappen plan training

Add the standing fingers to get the tens and multiply the closed fingers to get the units.

Ius Commune Training Programme Amsterdam Masterclass 16 June 2016

Ius Commune Training Programme Amsterdam Masterclass 22 June 2017

Op zoek naar de Hamilton cykel. Mike Hoffmeister

Grafen deel 2 8/9. Zesde college

After that, the digits are written after each other: first the row numbers, followed by the column numbers.

Quality requirements concerning the packaging of oak lumber of Houthandel Wijers vof ( )

HANDLEIDING - ACTIEVE MOTORKRAAN

THE WORK HET WERK HARALD BERKHOUT

Four-card problem. Input

IPSJ SIG Technical Report Vol.2014-CE-124 No /3/ Fundamental Experiments on Effects of Games in Rest Time between Learning MASAKAZU TAK

Laboratory report. Independent testing of material surfaces. Analysis of leaching substances in treated wood samples conform guide line EU 10/2011

GOVERNMENT NOTICE. STAATSKOERANT, 18 AUGUSTUS 2017 No NATIONAL TREASURY. National Treasury/ Nasionale Tesourie NO AUGUST

René Bos, T&M Consultant. Den Bosch 14 juni 2018

(1) De hoofdfunctie van ons gezelschap is het aanbieden van onderwijs. (2) Ons gezelschap is er om kunsteducatie te verbeteren

Verklaring kolommen Tape Lite

SLC 69, Strobl, Austria

Datamodelleren en databases 2011

DBMS. DataBase Management System. Op dit moment gebruiken bijna alle DBMS'en het relationele model. Deze worden RDBMS'en genoemd.

Esther Lee-Varisco Matt Zhang

AE1103 Statics. 25 January h h. Answer sheets. Last name and initials:

B1 Woordkennis: Spelling

Ik kom er soms tijdens de les achter dat ik mijn schoolspullen niet bij mij heb of niet compleet

NCTS - INFORMATIE INZAKE NIEUWIGHEDEN VOOR 2010

Issues in PET Drug Manufacturing Steve Zigler PETNET Solutions April 14, 2010

L.Net s88sd16-n aansluitingen en programmering.

Data Handling Ron van Lammeren - Wageningen UR

L.Net s88sd16-n aansluitingen en programmering.

Basic operations Implementation options

Intermax backup exclusion files

1. Een kortste pad probleem in een netwerk kan worden gemodelleerd als a. een LP probleem. b. een IP probleem. c. een BIP probleem. d.

Opgave 2 Geef een korte uitleg van elk van de volgende concepten: De Yield-to-Maturity of a coupon bond.

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

Chapter 4 Understanding Families. In this chapter, you will learn

ANGSTSTOORNISSEN EN HYPOCHONDRIE: DIAGNOSTIEK EN BEHANDELING (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Tentamen Calculus B (2WBB1) op maandag 28 januari 2013, 14:00 17:00 uur

Chromosomal crossover

Game Usability. Les 3 jaar 2. Ontwerp doelstellingen en randvoorwaarden

Seminarium en Onderzoek

Free Electives (15 ects)

Developments in SWAT modelling

WISB134 Modellen & Simulatie. Lecture 4 - Scalaire recursies

FOD VOLKSGEZONDHEID, VEILIGHEID VAN DE VOEDSELKETEN EN LEEFMILIEU 25/2/2016. Biocide CLOSED CIRCUIT

Classification of triangles

VOORBEELDIG LEREN. Milou van Harsel. Promovendus Universiteit Utrecht Lectoraat Brein & Leren Avans Hogeschool

The 15 puzzle invented by Noyes Chapman consisted of a $4 \times 4$ grid of which the field are numbered from 1 to 15.

Question-Driven Sentence Fusion is a Well-Defined Task. But the Real Issue is: Does it matter?

Meetkunde en Lineaire Algebra

Registratie- en activeringsproces voor de Factuurstatus Service NL 1 Registration and activation process for the Invoice Status Service EN 10

PROJECT INFORMATION Building De Meerlanden Nieuweweg 65 in Hoofddorp

DALISOFT. 33. Configuring DALI ballasts with the TDS20620V2 DALI Tool. Connect the TDS20620V2. Start DALISOFT

Transcriptie:

kool, geit en wolf algoritmiek, NP-compleet en een beetje latijn Leidsche Flesch Lunsch-lezing Hendrik Jan Hoogeboom 7.10 15 1

Algoritmiek: een puzzel

3 transportation problems

kool, geit, wolf kgw+ kw+g bkgw+ bg b kw+gb kw+g gw+k kg+w w+kg k+wg g+kw bkw+g bw k+wgb bg bkg+w bk bk w+kgb bg bgw+k bw g+kwb g+kw +kgw bg+kw b bg +kgwb 4

Propositiones ad Acuendos Juvenes Alcuinus van York (York ~735 - Tours 804) XVIII. PROPOSITIO DE HOMINE ET CAPRA ET LVPO. Homo quidam debebat ultra fluuium transferre lupum, capram, et fasciculum cauli. Et non potuit aliam nauem inuenire, nisi quae duos tantum ex ipsis ferre ualebat. Praeceptum itaque ei fuerat, ut omnia haec ultra illaesa omnino transferret. Dicat, qui potest, quomodo eis illaesis transire potuit? Solutio Simili namque tenore ducerem prius capram et dimitterem foris lupum et caulum. Tum deinde uenirem, lupumque transferrem: lupoque foris misso capram naui receptam ultra reducerem; capramque foris missam caulum transueherem ultra; atque iterum remigassem, capramque assumptam ultra duxissem. Sicque faciendo facta erit remigatio salubris, absque uoragine lacerationis. 5 http://en.wikipedia.org/wiki/propositiones_ad_acuendos_juvenes

Propositiones ad Acuendos Juvenes Alcuinus van York (York ~735 - Tours 804) XVIII. PROPOSITIO DE HOMINE ET CAPRA ET LVPO. Homo quidam debebat ultra fluuium transferre lupum, capram, et fasciculum cauli. Et non potuit aliam nauem inuenire, nisi quae duos tantum ex ipsis ferre ualebat. Praeceptum itaque ei fuerat, ut omnia haec ultra illaesa omnino transferret. Dicat, qui potest, quomodo eis illaesis transire potuit? Solutio Simili namque tenore ducerem prius capram et dimitterem foris lupum et caulum. Tum deinde uenirem, lupumque transferrem: lupoque foris misso capram naui receptam ultra reducerem; capramque foris missam caulum transueherem ultra; atque iterum remigassem, capramque assumptam ultra duxissem. Sicque faciendo facta erit remigatio salubris, absque uoragine lacerationis. 6 http://en.wikipedia.org/wiki/propositiones_ad_acuendos_juvenes

LOGIC BOAT *kgw+ kw+g* *kw+g w+kg* k+wg* *gw+k *kg+w g+kw* *g+kw +kgw* 7 http://xkcd.com/1134/

jaloerse echtgenoten trip number left bank travel right bank (start) Aa Bb Cc 1 Ab Cc Aa 2 Ab Cc A a 3 A B C bc a 4 A B C a b c 5 Aa BC b c 6 Aa Bb Cc 7 a b AB Cc 8 a b c A B C 9 b a c A B C 10 b B Aa Cc 11 Bb Aa Cc (finish) Aa Bb Cc 8

missionarissen en kannibalen 3 missionarissen, 3 kannibalen, 2 per boot. als de missionarissen in de meerderheid zijn bekeren ze de kannibalen; hoe komen deze veilig naar de overkant? (k,m) k=0 of k m k=3 of k m (andere oever!) k start finish m 9 Cannibals and missionaries, Ruby Lim APL '92 Proc. int. conf. APL, 135-142 (1992)

missionarissen en kannibalen 3 missionarissen, 3 kannibalen, 2 per boot. als de missionarissen in de meerderheid zijn bekeren ze de kannibalen; hoe komen deze veilig naar de overkant? (k,m) k=0 of k m k=3 of k m (andere oever!) k start heen en weer! elf stappen finish m 10

Complexiteit: NP compleet

Turing machine (p,c,q,a,r) instructie p toestand c letter gelezen q nieuwe toestand a letter geschreven R richting verplaatst a a c c a c space 1 i p(n) time 1 k p(n) 12 A.M. Turing (1936). On Computable Numbers, with an Application to the Entscheidungs problem. Proc London Math Soc (1937) Emil Post. Finite Combinatory Processes Formulation 1, J Symbolic Logic (1936)

computation tree existential and universal states determinism nondeterminism alternation

existential and universal states computation = tree dimensions log. polynomial exp. space time space time determinism L P PSPACE EXPTIME nondeterminism NL NP NPSPACE NEXPTIME alternation AL AP APSPACE AEXPTIME AL AP APSPACE AEXPTIME P NP PSPACE EXPTIME NEXPTIME EXPSPACE NPSPACE NEXPSPACE Chandra, Kozen, Stockmeyer. 'Alternation', J ACM 1981.

reference Games, Puzzles, & Computation Robert A. Hearn Erik D. Demaine (2009, AKPeters) E. Demaine and R.A. Hearn. Constraint Logic: A Uniform Framework for Modeling Computation as Games. In: Proceedings of the 23rd Annual IEEE Conference on Computational Complexity, June 2008. http://www.dartmouth.edu/~rah/constraint-logic.pdf R.A. Hearn. Games, Puzzles, and Computation PhD thesis, MIT, 2006. http://www.dartmouth.edu/~rah/

Complexity of Games & Puzzles [Demaine, Hearn & many others] Rengo Kriegspiel? PSPACE PSPACE EXPTIME Undecidable bridge? P 0 players (simulation) NP 1 player (puzzle) PSPACE 2 players (game) NEXPTIME team, imperfect info

NL P NP PSPACE EXPTIME NEXPTIME NPSPACE game categories game categories and their natural complexities (polynomial) TM resources Rush Hour River Crossing unbounded SPACE bounded TIME PSPACE # zero simulation determ. PSPACE NPSPACE EXPTIME APSPACE P NP PSPACE AP one puzzle nondeterm. two game alternat. undecid NEXPTIME team imperfect informat. Toppling Dominoes TipOver

NP & TipOver NP 3SAT part I constraint logic graph games Chapter 5.1 Bounded NCL part II games in particular Chapter 9.1 TipOver

PSPACE & Plank Puzzle PSPACE QBF part I constraint logic graph games NCL part II games in particular plank puzzle (river crossing)

3SAT clause literal (negated) variable (w x y) (w x z) (x y z) 3 conjunctive normalform 3SAT given: given formula φ in 3CNF question: is φ satisfiable? (can we find a variable assignment making formula true) Cook 71/Levin 73 3SAT is NP-complete

TM computation specify computation at step k T iak cell i contains a H ik head at position i state q Q qk variabelen a a c c a c space 1 i p(n) time 1 k p(n)

specify computation at step k T iak cell i contains a H ik head at position i state q Q qk (p,a,p,a,0) for each p,a Cook/Levin c a c space 1 i p(n) conjunction of T ix[i]0 initial tape x[i]=x i or x[i]= Q q00 initial state H 00 initial position T iak T ibk single symbol a b Q pk Q qk single state p q H ik H jk single head i j T iak T ib.k+1 H ik changed only if written a b H ik Q pk T iak V (p,a,q,b,d) H i+d.k+1 Q q.k+1 T ib.k+1 Q h.p(n) accept time 1 k p(n)

Karp's 21 NP-complete problems SAT Satisfiability CNF 0 1 integer programming set packing Clique Vertex cover 3-Satisfiability Chromatic number Clique cover Exact cover set covering Feedback node set Feedback arc set Directed Hamilton Hitting set Steiner tree 3-dimensional matching Knapsack Undirected Hamilton Job sequencing Partition Max cut 23 Richard M. Karp (1972) Reducibility Among Combinatorial Problems

Tetris is NP complete Given an initial game board and a sequence of pieces, can the board be cleared? 1 2 3 4 Breukelaar, Demaine, Hohenberger, Hoogeboom, Kosters, Liben-Nowell. Tetris is Hard, Even to Approximate. Selected Papers from COCOON 2003. Int. J. of Comput Geom and Appl 2004.

Tetris is NP complete Given an initial game board and a sequence of pieces, can the board be cleared? 1 2 3 4

Tetris is NP complete Given an initial game board and a sequence of pieces, can the board be cleared? 1 2 3 4 yes!

Tetris is NP complete Given an initial game board and a sequence of pieces, can the board be cleared? reduction from 3-partitioning problem (can we divide set of numbers into triples?) end a=3 begin

generalized river crossing D drivers P passengers c capaciteit boot m max verplaatsingen verboden combinaties: F R rechteroever F L linkeroever F B boot D = { Man }, P = { Wolf, Goat, Cabbage }, F L = F R = { {Wolf, Goat}, {Goat, Cabbage}, {Wolf, Goat, Cabbage} }, F B =, c = 2, m = 100. verboden: want anders polynomiaal, nl. graaf-wandelen Thm. [Ito etal.] Polynomiaal als F B =, en m=. Ito, Langerman, Yoshida. Generalized River Crossing Problems, Th. Comp. Sys. 2015

3 dim matching gegeven: U,V,W, met U = V = W =k en M U x V x W vraag: bestaat er een P M met P =k die alle elementen één keer bevat? {a,b,c} x {p,q,r} x {x,y,z} M = { (a,p,y), (b,q,y), (b,r,x), (c,p,x), (c,q,z) }

3D matching U,V,W, met U = V = W =k en M U x V x W complement! reductie river crossing D=U {s}, P=V W, c=3, m=3k-1, F R =, F L =, F B C = { {u,v,w} (u,v,w) M } { {s,u 2i-1,u 2i } i k/2 } oplossing P = { (a,p,y), (b,r,x), (c,q,z) } oplossing {a,p,y} a {b,r,x} b {s,a,b}

Natural Computing: een model

nested compartments - information membranes communication nature inspires

region Structure in in in out skin membrane membrane keuze: type objecten, reacties, communicatie, output environment elementary region

simpele systemen Uniport Symport Antiport A A B A B alléén samen verplaatsen hoeveel membranen? hoeveel tegelijk? antiport nodig?

P systems with symport/antiport Păun & Păun Contents objects multiset symbols infinite supply in environment Rules regels per membraan ( a 1 a k b 1 b ) antiport ( a 1 a k ) symport (in) ( a 1 a k ) (out)

single membrane will do sadly enough B A A simuleer een counter automaton (=register machine) increment, decrement, zero test A q p p A A B toestand p counter A=2 B=1 # # (p q, +A) (p q, -A) ( qa p ) ( q pa ) counter aut antiport

infinite = blocking zero test: programming trick conflicting counters A & A A A # always present # (p q, A=0) ( A r p ) ( r r ) ( q r A ) +A wait -A ( # AA ) ( # # ) counter aut simulation antiport max parallellism: forced move verboden combinatie!

antiport to symport add drivers # A A A δ # q p ρ p A A ρ = ( qa p ) ( ρqa ) ( ρp ) speciaal voor deze regel ρ drie persoons bootje!

drie persoons-bootje + verboden combinatie conclusie we zijn weer terug! klaar

references Stephen Cook. The complexity of theorem proving procedures, Proc. 3rd Ann. ACM STOC (1971) pp. 151-158 H.J. Hoogeboom. Carriers and Counters: P Systems with Carriers vs. (Blind) Counter Automata, LNCS 2450 (2003) pp. 140-151 DOI 10.1007/3-540-45005-X_12 Hiro Ito, Stefan Langerman, Yuichi Yoshida. Generalized River Crossing Problems, Th. Comp. Sys. 56 (2015) 418-435 DOI 10.1007/s00224-014-9562-8