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

  • SEARCH
  • Home
  • 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 5988375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:57:00+00:00 2026-05-22T22:57:00+00:00

I am dealing with what amounts to squares on a grid. The grid if

  • 0

I am dealing with what amounts to squares on a grid. The grid if of a more or less infinite size. Grid squares can have one of two states, either claimed or unclaimed. The coordinates of the squares are stored as squares in an R tree for fast access. Before a square is unclaimed however, I want to iterate through the nearby claimed squares to ensure that by unclaiming this square, I am not splitting the claimed squares into 2 distinct regions. It’s important to note, that squares are already currently claimable only if they are touching an already claimed square.

So if I have something like

+++++++++

And if a player wants to remove the square to create

++++ ++++

Then I want to be able to detect and reject this action. Of course this needs to be able to handle the full 2 dimensional space as well ( I tried, but found it difficult to get this across in ascii art via the formatting available to me here). This must also be fairly efficient. Any pointers as to the name of an algorithm to look up or a description on how to do this would be wonderful <3

  • 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-22T22:57:00+00:00Added an answer on May 22, 2026 at 10:57 pm

    Do breadth-first searches on the neighbors of the removed grid point and see that the searches all meet each other.

    Search on the components without the removed grid point until either you exhaust it (the original claimed territory) or meet the other breadth first searches in another location.

    For example, if you have the region on the left, and removal results on the right:

    +++     + +
    + +     + +
    + +  -> + +
    +++     +++
    

    (the middle of the top is removed)

    now do two breadth first parallel searches: (numbers or letters show number of squares traveled from removed piece)

    1 a
    2 b
    3 c
    4xd
    

    The connection at x is going to be reached in the 5th step of both breadth first searches, indicating removing the top middle grid does not create two separate regions.

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

Sidebar

Related Questions

I am dealing with a project, in wich I have written one Exception for
I am dealing with large amounts of scientific data that are stored in tab
At the moment I am dealing with large amounts of float/double datasets to be
Lets assume that I'm dealing with a service that involves sending large amounts of
Hello I have a django app dealing with Sales/purchases. What I want to do
Dealing with Java - which the option you prefer in the most cases -
When dealing with a series of numbers, and wanting to use hash results for
When dealing with a single file, I'm used to: /blah do some work n
When dealing with a collection of key/value pairs is there any difference between using
When dealing with events, people are usually taking examples of very simple values object

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.