Skip to content

Add suboptimal search option - #42

Merged
arjo129 merged 24 commits into
mainfrom
arjoc/temp-benchmark-focal
Sep 8, 2026
Merged

Add suboptimal search option#42
arjo129 merged 24 commits into
mainfrom
arjoc/temp-benchmark-focal

Conversation

@arjo129

@arjo129 arjo129 commented Apr 9, 2026

Copy link
Copy Markdown
Member

New feature implementation

Implemented feature

This PR introduces FOCAL search into the negotiation loop. Unlike standard Best-First Search which focuses purely on cost, FOCAL search prioritizes nodes within a sub-optimal bound f(n) <= weight * min_cost that have the fewest conflicts. This allows the solver to find valid paths significantly faster in congested environments by proactively avoiding agents.

Key Changes

  • FOCAL Search Logic: Implemented a two-tiered priority queue system for pathfinding.
  • Weight Tuning: Evaluated performance with weights of 1.1 and 1.5.

Benchmark Results: Weight Comparison

The following table compares the baseline (Standard Best-First) against FOCAL search with weights of 1.1 and 1.5.

Map:Scenario Agents Baseline Focal 1.1 Focal 1.5 Speedup (1.5 vs Baseline)
empty-32-32 20 2.47s 1.48s 0.55s 4.50x
room-32-32-4 10 Timeout 0.39s 0.42s Solved
empty-32-32 15 0.55s 0.53s 0.52s 1.06x
room-32-32-4 5 0.39s 0.36s 0.36s 1.08x

Observations:

  • Focal 1.5: Delivered a 4.5x speedup in high-density scenarios (20 agents). It is the most robust setting for avoiding timeouts in congested areas.
  • Focal 1.1: Successfully resolved complex scenarios (e.g., room-32-32-4 with 10 agents) that the baseline could not, but was slower than 1.5 in open-space congestion.
  • Baseline: Frequently timed out as agent density increased due to over-prioritizing shortest paths that were heavily contested.

Conclusion

Setting focal_weight to 1.5 provides the best balance between path optimality and search speed, resolving complex scenarios that previously timed out while offering substantial speedups in high-traffic areas.

Verification

  • Automated benchmarks run across empty, room, maze, and random maps from the Moving AI dataset.
  • Verified that all successful runs maintain valid, collision-free paths.

GenAI Use

We follow OSRA's policy on GenAI tools

  • I used a GenAI tool in this PR.
  • I did not use GenAI

Generated-by: Gemini-CLI

arjo129 and others added 7 commits April 7, 2026 05:39
I think the root cause of #27 is this. I'm not sure why it was not being triggered earlier,
but seems like we are accessing an 8 bit bitfield but limiting the index to `u8::MAX`instead of 7.

Signed-off-by: Arjo Chakravarty <arjo129@gmail.com>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Co-authored-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
The project now includes:
- mapf-bench crate: A tool for running multi-agent negotiation benchmarks on Moving AI grid maps.
- scripts/benchmark.py: An automated script that downloads maps/scenarios, runs benchmarks for 2-50 agents, and generates reports with strict timeouts.
- .gitignore update: The cache/ directory used for benchmarking data is now ignored.

Generated-by: Gemini-CLI
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
@mxgrey mxgrey added this to PMC Board Apr 9, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in PMC Board Apr 9, 2026
@arjo129 arjo129 changed the title Arjoc/temp benchmark focal Add suboptimal search option. Seee how much more effective it is. Apr 9, 2026
@arjo129
arjo129 marked this pull request as draft April 9, 2026 09:03
@arjo129 arjo129 changed the title Add suboptimal search option. Seee how much more effective it is. Add suboptimal search option Apr 10, 2026
@arjo129
arjo129 force-pushed the arjoc/temp-benchmark-focal branch 2 times, most recently from 24c130a to a04f3b2 Compare April 10, 2026 00:59
arjo129 added 3 commits April 10, 2026 01:13
…sults

Generated-by: Gemini-CLI
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Generated-by: Gemini-CLI
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Generated-by: Gemini-CLI
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
@arjo129
arjo129 force-pushed the arjoc/temp-benchmark-focal branch from a04f3b2 to 6b25f8b Compare April 10, 2026 01:13
This change allows for tunable suboptimality in the negotiation process by introducing a weight parameter to the focal search. A negotiate wrapper is provided for backward compatibility.

Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
@arjo129
arjo129 marked this pull request as ready for review April 10, 2026 08:21
@arjo129
arjo129 requested a review from mxgrey April 10, 2026 08:21
@arjo129 arjo129 moved this from Inbox to In Review in PMC Board Apr 21, 2026
Comment thread focal_benchmark_results.md Outdated
arjo129 added 7 commits June 18, 2026 02:28
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
…ocal

Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
arjo129 and others added 4 commits June 26, 2026 06:25
Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Base automatically changed from arjoc/feat/benchmark-infra to main September 8, 2026 00:44
…-focal

Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>

@mxgrey mxgrey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tweaked the implementation to reduce cloning and to make the safety arguments more clear: 240d560

@mxgrey

mxgrey commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@arjo129 go ahead and merge if you're okay with the changes in 240d560

@arjo129
arjo129 merged commit bd3bab5 into main Sep 8, 2026
4 checks passed
@arjo129
arjo129 deleted the arjoc/temp-benchmark-focal branch September 8, 2026 01:59
@github-project-automation github-project-automation Bot moved this from In Review to Done in PMC Board Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants