a model seeker extrac1ng global constraint models from
play

A Model Seeker: Extrac1ng Global Constraint Models From - PowerPoint PPT Presentation

A Model Seeker: Extrac1ng Global Constraint Models From Posi1ve Examples N. Beldiceanu * and H. Simonis + * TASC team (INRIA/CNRS), Mines de Nantes, France


  1. A ¡Model ¡Seeker: ¡ Extrac1ng ¡Global ¡Constraint ¡ Models ¡From ¡Posi1ve ¡Examples ¡ ¡ ¡ N. ¡Beldiceanu * ¡ and ¡ H. ¡Simonis + ¡ * TASC ¡team ¡(INRIA/CNRS), ¡Mines ¡de ¡Nantes, ¡France ¡ + 4C, ¡University ¡College ¡Cork, ¡Ireland ¡ ¡ ¡

  2. In ¡Pursuit ¡of ¡the ¡Holy ¡Grail ¡ • “Constraint ¡Programming ¡represents ¡one ¡of ¡ the ¡closest ¡approaches ¡computer ¡science ¡has ¡ yet ¡made ¡to ¡the ¡Holy ¡Grail ¡of ¡programming: ¡ the ¡user ¡states ¡the ¡problem, ¡the ¡computer ¡ solves ¡it.” ¡[E. ¡Freuder] ¡ • This ¡is ¡boring: ¡we ¡don’t ¡want ¡to ¡state ¡the ¡ problem, ¡the ¡computer ¡should ¡do ¡this ¡as ¡well! ¡

  3. What ¡is ¡it ¡all ¡about ¡? ¡ problem ¡ From ¡sample ¡ C. ¡Durr ¡(exam) ¡ ¡ to ¡model ¡ 3 ¡ ¡0 ¡ ¡2 ¡ ¡1 ¡ alldifferent(<V 1 ,V 2 ,V 3 ,V 4 >) ¡ alldifferent_interval(<V 1 ,V 2 >, ¡2) ¡ LEARNING ¡ alldifferent_interval(<V 3 ,V 4 >, ¡2) ¡

  4. Points ¡to ¡remember ¡ • Learning ¡constraint ¡models ¡from ¡posiUve ¡examples ¡ • Start ¡with ¡ vector ¡ of ¡values ¡ • Group ¡into ¡ regular ¡paYern ¡ • Find ¡constraint ¡paWern ¡that ¡apply ¡to ¡group ¡elements ¡ ¡ • Using ¡ Constraint ¡Seeker ¡ for ¡ Global ¡Constraint ¡ Catalog ¡ • Works ¡for ¡ highly ¡structured ¡ problems ¡

  5. Overview ¡ • Mo1va1on ¡ • Input ¡Format ¡ • An ¡Example ¡ • Learning ¡Algorithm ¡ – TransformaUons ¡ – ParUUon ¡Generators ¡ – Constraint ¡Seeker ¡ – Relevance ¡OpUmizer ¡ – Dominance ¡Check ¡ • EvaluaUon ¡ • Conclusion ¡

  6. Mo1va1on ¡ • Constraint ¡models ¡can ¡be ¡hard ¡to ¡write ¡ • Can ¡we ¡generate ¡them ¡automaUcally? ¡ • User ¡gives ¡example ¡soluUons ¡ • Systems ¡suggest ¡ compact ¡conjunc1ons ¡ of ¡ similar ¡ constraints ¡ • Users ¡accepts/rejects ¡constraints ¡and/or ¡ gives ¡more ¡samples ¡

  7. Global ¡Constraints ¡ • Define ¡abstracUons ¡occurring ¡in ¡real-­‑world ¡ situaUons ¡ ¡ – Useful ¡in ¡mulUple ¡problems ¡ – As ¡general ¡as ¡possible ¡(complexity) ¡ – Perform ¡beWer ¡propagaUon ¡than ¡naïve ¡models ¡ – SomeUmes: ¡Balance ¡propagaUon/effort ¡ • Classical ¡Example: ¡alldifferent ¡ – Works ¡on ¡sets ¡of ¡variables, ¡they ¡must ¡be ¡pairwise ¡ different ¡ – Algorithmic ¡choices/amount ¡of ¡propagaUon ¡ ¡ ¡

  8. Global ¡Constraint ¡Catalog ¡ • SystemaUc ¡descripUon ¡of ¡published ¡global ¡ constraints ¡ • Started ¡from ¡1999 ¡by ¡Beldiceanu, ¡Carlsson ¡ and ¡Rampon ¡(SICS, ¡EMN) ¡ • 400 ¡constraints ¡on ¡3000 ¡pages ¡ • Formal ¡definiUons, ¡meta-­‑data ¡and ¡links ¡

  9. • MoUvaUon ¡ • Input ¡Format ¡ • An ¡Example ¡ • Learning ¡Algorithm ¡ – TransformaUons ¡ – ParUUons ¡Generators ¡ – Constraint ¡Seeker ¡ – Relevance ¡OpUmizer ¡ – Dominance ¡Check ¡ • EvaluaUon ¡ • Conclusion ¡

  10. User ¡oriented ¡input ¡format ¡ Ideally, ¡starts ¡from ¡the ¡format ¡used ¡in ¡books, ¡on ¡the ¡web ¡ for ¡presenUng ¡the ¡soluUon ¡of ¡a ¡problem. ¡ ( there ¡may ¡be ¡ more ¡than ¡one ¡ way ) ¡ ¡ Very ¡ohen ¡soluUons ¡are ¡represented ¡as ¡ one ¡(or ¡several) ¡ tables , ¡ boards , ¡ grids , ¡… ¡, ¡ with ¡(someUme) ¡extra ¡informaUon ¡( hints , ¡parameters ) ¡ ¡ ¡

  11. Input ¡format: ¡flat ¡sequence ¡of ¡integers ¡ different ¡representa1ons ¡ 2 ¡4 ¡6 ¡8 ¡3 ¡1 ¡7 ¡5 ¡ for ¡the ¡ same ¡ solu1on ¡ (posi1ons ¡in ¡the ¡different ¡columns, ¡ start ¡from ¡1 ) ¡ 1 ¡3 ¡5 ¡7 ¡2 ¡0 ¡6 ¡4 ¡ Source: ¡wikipedia ¡ (posi1ons ¡in ¡the ¡different ¡columns, ¡ start ¡from ¡0 ) ¡ 2 ¡12 ¡22 ¡32 ¡35 ¡41 ¡55 ¡61 ¡ (index ¡of ¡cells, ¡ start ¡from ¡1, ¡ordered ) ¡ 22 ¡12 ¡55 ¡61 ¡32 ¡35 ¡2 ¡41 ¡ (index ¡of ¡cells, ¡ start ¡from ¡1, ¡not ¡ordered ) ¡ 1 ¡2 ¡2 ¡4 ¡3 ¡6 ¡4 ¡8 ¡5 ¡3 ¡6 ¡1 ¡7 ¡7 ¡8 ¡5 ¡ (coordinates ¡of ¡cells, ¡ start ¡from ¡1, ¡ordered ) ¡ 0 ¡1 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡1 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡1 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡1 ¡0 ¡0 ¡1 ¡0 ¡ 0 ¡0 ¡0 ¡0 ¡1 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡0 ¡1 ¡0 ¡0 ¡0 ¡0 ¡0 ¡1 ¡0 ¡0 ¡0 ¡ (flat ¡0/1 ¡matrix, ¡ 1 ¡for ¡occupied ¡cells ) ¡

  12. • MoUvaUon ¡ • Input ¡Format ¡ • An ¡Example ¡ • Learning ¡Algorithm ¡ – TransformaUons ¡ – ParUUons ¡Generators ¡ – Constraint ¡Seeker ¡ – Relevance ¡OpUmizer ¡ – Dominance ¡Check ¡ • EvaluaUon ¡ • Conclusion ¡

  13. Constraint ¡exam ¡( Polytechnique ¡2011 ) ¡ ORIGINAL ¡QUESTION ¡ ¡( in ¡French ) ¡ hYp://www.enseignement.polytechnique.fr/informa1que/INF580/exams/ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡C. ¡Durr ¡ ¡ AN ¡EXAMPLE ¡

  14. n ¡Samuraïs: ¡model ¡ sample ¡ model ¡ 3 ¡ ¡0 ¡ ¡2 ¡ ¡1 ¡

  15. n ¡Samuraïs: ¡model ¡ samples ¡ model ¡ 3 ¡ ¡0 ¡ ¡2 ¡ ¡1 ¡ 0 ¡ ¡2 ¡ ¡1 ¡ ¡3 ¡ Eliminated ¡ ¡if ¡ ¡we ¡ ………….. ¡ provide ¡more ¡ ¡samples ¡

  16. n ¡Samuraïs ¡model ¡ ( two ¡conjunc?ons ¡of ¡similar ¡constraints ) ¡ alldifferent_consecu1ve_values (<V 1 ,V 2 ,V 3 ,V 4 >) ¡ alldifferent_interval (<V 1 ,V 2 >, ¡2) ¡ reformula1on ¡ alldifferent_interval (<V 3 ,V 4 >, ¡2) ¡ V 1 =2*Q 1 +R 1 ¡ ¡ (0 ¡≤ ¡R 1 ¡ <2) ¡ V 2 =2*Q 2 +R 2 ¡ ¡ (0 ¡≤ ¡R 2 ¡ <2) ¡ alldifferent(<Q 1 ,Q 2 >) ¡

  17. • MoUvaUon ¡ • Input ¡Format ¡ • An ¡Example ¡ • Learning ¡Algorithm ¡ – TransformaUons ¡ – ParUUon ¡Generators ¡ – Constraint ¡Seeker ¡ – Relevance ¡OpUmizer ¡ – Dominance ¡Check ¡ • EvaluaUon ¡ • Conclusion ¡

  18. Workflow ¡of ¡the ¡learning ¡procedure ¡ ( from ¡samples ¡to ¡program ) ¡ sample(s) ¡ • TransformaUons ¡ 2 ¡4 ¡6 ¡8 ¡3 ¡1 ¡7 ¡5 ¡ • ParUUon ¡generators ¡ • Arguments ¡creaUon ¡ • Constraint ¡seeker ¡ number ¡ of ¡learned ¡ • Relevance ¡opUmizer ¡ conjunc1ons ¡ • Domain ¡creaUon ¡ • Link ¡between ¡objects ¡aWributes ¡ • Dominance ¡check ¡(crucial) ¡ model ¡ • Trivial ¡suppression ¡ • Code ¡generaUon ¡ ( catalog ¡syntax, ¡FlatZinc ) ¡

  19. Transforma1ons ¡ • Extract ¡ substructures ¡from ¡samples ¡ – ExtracUng ¡ overlapping ¡grids ¡ from ¡ irregular ¡shapes ¡ – DisUnguish ¡ main ¡grid ¡ from ¡ hints ¡on ¡column ¡and/or ¡rows ¡ ¡ ¡ • Derive ¡ new ¡samples ¡from ¡samples ¡ – Build ¡ triangular ¡differences ¡table ¡ – Take ¡ sign ¡and/or ¡ absolute ¡value ¡ ¡ • Handle ¡ mul1ple ¡input ¡formats ¡ ( in ¡a ¡ transparent ¡ way ) ¡ – ¡ Bijec1on ¡ – ¡ Tour/Path ¡ – ¡Domina1on ¡in ¡graphs ¡

  20. Transformations, example 1 ( Extracting overlapping grids from irregular shapes ) Flower ¡Sudoku ¡ IDEA ¡ ¡Cover ¡the ¡non-­‑empty ¡space ¡by ¡the ¡ minimum ¡ number ¡of ¡rectangles ¡in ¡ such ¡a ¡way ¡that ¡the ¡ maximum ¡ intersec1on ¡between ¡any ¡pairs ¡ of ¡rectangles ¡is ¡ minimized . ¡ ¡ use ¡a ¡constraint ¡program ¡

  21. Transforma1ons, ¡Example ¡2 ¡ ( tours/paths ) ¡ check ¡that ¡the ¡underlying ¡graph ¡is ¡regular ¡ ¡ ¡ Convert ¡to ¡successor ¡representa?on ¡and ¡ …………………………… ¡ Euler ¡ first ¡example ¡ on ¡open ¡ knight’s ¡tour ; ¡ … ¡ the ¡numbers ¡mark ¡the ¡order ¡of ¡the ¡cells ¡ … ¡ the ¡knight ¡visit ¡ … ¡ … ¡ … ¡ Leaper ¡graphs ¡ in ¡Selected ¡Papers ¡ … ¡ on ¡Fun ¡and ¡Games ¡[ Knuth 2010 ] ¡ … ¡ the ¡tour ¡is ¡given ¡in ¡base ¡9 ¡ … ¡ ( in ¡order ¡to ¡highlight ¡symmetries ) ¡ ………………………………… ¡ Number ¡links ¡ ( Nikoli ) ¡ all ¡cells ¡belonging ¡to ¡a ¡same ¡path ¡ are ¡labelled ¡by ¡the ¡same ¡number ¡ ………………………… ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend