Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3243368
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:25:27+00:00 2026-05-17T18:25:27+00:00

I sort of understand the concept of pathfinding and how a program looks for

  • 0

I sort of understand the concept of pathfinding and how a program looks for point B from point A in the most efficient manner and vaguely familiar with the concept of A*. But what if, instead of trying to find a way through the maze, you’re trying to find the longest corridor in closed off maze where the corridor can not be on a diagonal.

Here’s my example maze:

1 1 0 1
0 0 1 1
1 0 1 0
1 0 1 0

If using 1’s as the allowed path and 0’s as an invalid path, the longest path is 5 with the coordinates being (0,3), (1,2), (1,3), (2,2), (3,2).

How would I find this information recursively?

I’ve been racking my brain on how to start from (0,0) and go up, down, left, right to see if those are possible moves, but any version I come up with encounters duplicates and repeated counts.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:25:27+00:00Added an answer on May 17, 2026 at 6:25 pm

    I would look at a flood fill algorithm.

    Basically start at the first 1 – flood fill from there, and count the filled positions. Set those to 0 (even as you go), and repeat.

    I think there are ways to parallelize this exact problem as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I sort of understand the motivation for a String Builder class, but do all
I sort of understand why this is happening, but not entirely. I have a
So I'm currently trying to grasp the concept of recursion, and I understand most
I'm a newbie at networking. I understand the concept of multicast, but was wondering
I sort of understand this, at least the function of generators (I've used them
Okay, I understand what the problem is, I sort of understand constraints in that
I understand the JS .sort() function well enough, and I have a loose grasp
I don't understand how using a 'challenge token' would add any sort of prevention:
Comparison sort is opted for in most of the scenarios where data needs to
I know this sort of question has been asked before , but I still

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.