DEV Community

Lem-in: Shortest Path Isn't Always the Goal (opens in new tab)

Discussed on DEV

My team just started lem-in, the next project after Groupie Tracker. You've got a colony of rooms and tunnels, a pile of ants at ##start, and the job is to get them all to ##end as fast as possible. My first thought was "easy, just BFS for the shortest path." Turns out that's the wrong instinct. Say the shortest path is 5 rooms long and you've got 50 ants. Send them all down that one path and they queue up single-file, taking way more turns than you'd think. But if there's a second, slightly ...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help