Slide 1

Slide 1 text

Combinatorial Search with Generators kei18 https://kei18.github.io [email protected] 16th May. 2024, Monash University Keisuke Okumura1,2 1University of Cambridge 2National Institute of Advanced Industrial Science and Technology (AIST) Image by Oberholster from Pixabay

Slide 2

Slide 2 text

/59 2 0, 1, 1, 2, 3, 5, 8, 13, 21, …

Slide 3

Slide 3 text

/59 3 F0 F1 Fn = 0 = 1 = Fn-1 + Fn-2 Fibonacchi Sequence Image by Karin Henseler from Pixabay

Slide 4

Slide 4 text

/59 4 Python Coding - Recursive

Slide 5

Slide 5 text

/59 5 Python Coding - Iterative

Slide 6

Slide 6 text

/59 6 Python Coding - Generative Pause the process. You can resume from here the next time you call.

Slide 7

Slide 7 text

/59 7 When are Generators Useful? tokenization

Slide 8

Slide 8 text

/59 8 Data Stream Data Batch Generator Computation Image by Oberholster and Venita Prawny from Pixabay

Slide 9

Slide 9 text

/59 9 Data Batch Generator Data Stream Computation

Slide 10

Slide 10 text

/59 10 start goal Combinatorial Search start goal f = g + h search tree

Slide 11

Slide 11 text

/59 11 Combinatorial Search start goal search tree branching factor (number of successor nodes) grid pathfinding 25-40 chess 4 e.g.,

Slide 12

Slide 12 text

/59 12 difficult / impossible to list all e.g., ≥ #atoms in the universe Sometimes We Encounter:

Slide 13

Slide 13 text

/59 13 Data Stream

Slide 14

Slide 14 text

/59 14 Successor Batch Combinatorial Search with Generators

Slide 15

Slide 15 text

/59 15 Pathfinding with Massive Implicit Edges

Slide 16

Slide 16 text

/59 16 start goal 10,000 vertices connected to another if they can see each other i.e., |E| = O(|V|2) obstacle

Slide 17

Slide 17 text

/59 17

Slide 18

Slide 18 text

/59 18 with Julia Implementation A*: failed with 1h timeout Greedy Best-First Search: ≥9min RRT-Connect: ≥3min (ignoring vertices)

Slide 19

Slide 19 text

/59 19 Limiting Successors – Nearest Neighbors start goal 3 neighbors excluded from search effort

Slide 20

Slide 20 text

/59 20 Limiting Successors - Pitfall start goal obstacle 3 neighbors

Slide 21

Slide 21 text

/59 21 perfect but inefficient efficient but imperfect

Slide 22

Slide 22 text

/59 22 Generator: K-Nearest Neighbor Search on K-d Tree

Slide 23

Slide 23 text

/59 23 K-d Tree data structure suitable to query for the nearest points

Slide 24

Slide 24 text

/59 24 data structure suitable to query for the nearest points K-d Tree

Slide 25

Slide 25 text

/59 25 data structure suitable to query for the nearest points K-d Tree

Slide 26

Slide 26 text

/59 26 data structure suitable to query for the nearest points omitting backtracking phase finding the nearest neighbor : brute force k-d tree O(n) O(log n) easy to extend: “find k nearest neighbors with distance >θ” K-d Tree

Slide 27

Slide 27 text

/59 27 K-d Tree Search as Generator Setup: Set distance threshold θ as zero For each call: 1. Find k nearest neighbors with distance >θ 2. Update θ to a max distance within the batch

Slide 28

Slide 28 text

/59 28 Pathfinding with Generator 1st visit

Slide 29

Slide 29 text

/59 29 Pathfinding with Generator 2nd visit

Slide 30

Slide 30 text

/59 30 Pathfinding with Generator excluded from search effort

Slide 31

Slide 31 text

/59 31 If We Continue 1st visit

Slide 32

Slide 32 text

/59 32 If We Continue 2nd visit

Slide 33

Slide 33 text

/59 33 If We Continue

Slide 34

Slide 34 text

/59 34 Anytime Algorithm previous updated that eventually converges to optimal solutions

Slide 35

Slide 35 text

/59 35 Setup: Set distance threshold θ as zero For each call: 1. Find k nearest neighbors with distance >θ 2. Update θ to a max distance within the batch K-d Tree Generator adding constraints lazily to visit all successors eventually Lazy Constraints Addition Search for single-agent; LaCAS(*)

Slide 36

Slide 36 text

/59 36 Demo of LaCAS solution path search progress start goal

Slide 37

Slide 37 text

/59 37 with Julia Implementation A*: failed with 1h timeout Greedy Best-First Search: ≥9min RRT-Connect: ≥3min (ignoring vertices) LaCAS: ~30s LaCAT: ~40s (Theta* like LaCAS) LaCAT* after 10 min (anytime algorithm)

Slide 38

Slide 38 text

/59 38 Starting from unbounded suboptimal solutions Easy to design anytime algorithm that eventually converges to optimal solutions => Useful for problems with huge branching factors Gradually generate successors as the search progress Characteristics of Combinatorial Search with Generators

Slide 39

Slide 39 text

/59 39 => MAPF: Multi-Agent Pathfinding Pathfinding with massive implicit edges; Understood, but too simple. More convincing examples?

Slide 40

Slide 40 text

/59 40 given agents graph goals solution paths without collisions cost total travel time, distance, makespan, etc MAPF: Multi-Agent Path Finding

Slide 41

Slide 41 text

/59 41 AP Photo/Ross D. Franklin Ross D. Franklin / AP Photo "Swarm" automation is ubiquitous

Slide 42

Slide 42 text

/59 42 … … … … … search node (configuration) goal configuration Vanilla A* for MAPF

Slide 43

Slide 43 text

/59 43 runtime (sec) solved instances (%)                - 13,900 instances - 33 grid maps - every 50 agents, up to max. (1000) - tested on standard desktop PC Stern, R. et al. Multi-Agent Pathfinding: Definitions, Variants, and Benchmarks. SoCS. 2019. 33 grid maps e.g., random-32-32-20, 200 agents Evaluation on MAPF benchmark maze-32-32-2, 100 agents 00.0% A* [Hart+ 68] complete optimal algorithm properties computation time

Slide 44

Slide 44 text

/59 44 Reason for Poor Performance of A* O(5^N) N: #agents MAPF has a huge branching factor: 3,125 9,765,625 95,367,431,640,625 931,322,574,615,478,515,625 9,094,947,017,729,282,379,150,390,625 88,817,841,970,012,523,233,890,533,447,265,625 5^5 5^10 5^20 5^30 5^40 5^50 For 10k agents? Ridiculous!

Slide 45

Slide 45 text

/59 45 Data Stream Generator: MAPF Algorithm with Short Planning Horizon

Slide 46

Slide 46 text

/59 must go left in the next config. 46 constraint tree (maintained implicitly) configuration (search node) Generator for MAPF – 1/4

Slide 47

Slide 47 text

/59 47 1st invoke configuration generation with no constraint Generator for MAPF – 1/4

Slide 48

Slide 48 text

/59 48 2nd invoke configuration generation with Generator for MAPF – 1/4

Slide 49

Slide 49 text

/59 49 e.g., breadth-first search 24th invoke configuration generation with eventually visit all neighbor configurations Generator for MAPF – 1/4

Slide 50

Slide 50 text

/59 50 How can we generate a promising configuration following constraints?

Slide 51

Slide 51 text

/59 51 PIBT PIBT initial configuration PIBT goal configuration There are MAPF algorithms that sequentially generate configurations, e.g., PIBT Okumura, K., Machida, M., Défago, X., & Tamura, Y. Priority Inheritance with Backtracking for Iterative Multi-agent Path Finding. AIJ. 2022. (extended from IJCAI’19*) use such algorithms to generate promising configurations

Slide 52

Slide 52 text

/59 52 For each call: 1. Develop the constraint tree 2. Generate configurations with constraints using short-horizon MAPF algorithms Generator for MAPF adding constraints lazily to visit all successors eventually Lazy Constraints Addition Search for multi-agent; LaCAM(*)

Slide 53

Slide 53 text

/59 53 A* / PIBT 0% with 400 agents 100%, worst: 11sec LaCAM #agents success rate random-32-32-20, 32x32, 30sec timeout, 400 agents Performance of LaCAM           

Slide 54

Slide 54 text

/59 54                67.4% PIBT 0.0% A* [Hart+ 68] 99.0% LaCAM*+ fine-tuned PIBT runtime (sec) solved instances (%) Okumura, K. Improving LaCAM for Scalable Eventually Optimal Multi-Agent Pathfinding. IJCAI. 2023. 85.6% LaCAM + vanilla PIBT Okumura, K. LaCAM: Search-Based Algorithm for Quick Multi-Agent Pathfinding. AAAI. 2023. Okumura, K., Machida, M., Défago, X., & Tamura, Y. Priority Inheritance with Backtracking for Iterative Multi-agent Path Finding. AIJ. 2022.

Slide 55

Slide 55 text

/59 55                runtime (sec) solved instances (%) 0.0% A* [Hart+ 68] 0.4% ODrM* [Wagner+ AIJ’15] 8.3% CBS [Sharon+ AIJ’15; Li+ AIJ’21] 10.7% BCP [Lam+ COR’22] 30.9% I-ODrM*-5 [Wagner+ AIJ’15] 50.5% EECBS-5 [Li+ AAAI’21] 61.4% PP [Silver AIIDE’05] 80.9% LNS2 [Li+ AAAI’22] 67.4% PIBT [Okumura+ AIJ’22] complete solution complete complete solution complete bounded suboptimal bounded suboptimal optimal optimal (unable to identify unsolvable instances) incomplete suboptimal 85.6% LaCAM [Okumura AAAI’23] 99.0% LaCAM* [Okumura IJCAI’23] complete complete eventually optimal suboptimal lose nice props.

Slide 56

Slide 56 text

/59 56 LaCAM* suboptimally solves MAPF for 10k agents in a warehouse-style map with many narrow corridors, in 5 seconds on my laptop

Slide 57

Slide 57 text

/59 59 Summary: Combinatorial Search with Generators Successor Batch Generator Search Pathfinding with Massive Implicit Edges Multi-Agent Pathfinding

Slide 58

Slide 58 text

/59 60 Thank you for listening! Acknowledgements to mentors / collaborators: X. Defago, Y. Tamura, F. Bonnet + members of DEFAGO Lab (TokyoTech) R. Yonetani + co-authors (OSX) S. Tixeuil (LIP6, Sorbonne) J. Alkazzi (idealworks) A. Prorok + members of PROROK Lab (Cambridge) Funding: JSPS DC & Overseas Research Fellowship, JST ACT-X, Yoshida Scholarship Foundation kei18 https://kei18.github.io [email protected] Questions / research collaboration proposals are welcome: