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 7811099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:02:19+00:00 2026-06-02T04:02:19+00:00

Given a grid map where each cell can be described by a pair (x,

  • 0

Given a grid map where each cell can be described by a pair (x, y), and a vector of such cells, how can I (nicely) check if the cells in that vector form a ‘tunnel’, ie. they are all lined up either vertically or horizontally? But what if I only want to see if most of them are lined up (and not all)?

All are lines up             Most are lined up      Not lined up

                             C                       C C C
 C C C C C C C C             C C C C C C C C         C   C C C
                                 C                   C C C C
                                                         C C
  • 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-06-02T04:02:24+00:00Added an answer on June 2, 2026 at 4:02 am

    You could calculate the standard deviation of both the X and Y coordinates. The more ‘tunnelled’ your cells are, the lower the std deviation will be for either X or Y.

    For example, in Python:

    import numpy
    
    def is_tunnelled(cells):
        # given cells=[(x,y), (x,y),...]
        x_values, y_values = zip(*cells)
        lowest_std_dev = min(numpy.std(x_values), numpy.std(y_values))
        return lowest_std_dev < STD_DEVIATION_THRESHOLD
    

    It’s up to you to determine what the value of STD_DEVIATION_THRESHOLD should be.

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

Sidebar

Related Questions

Given a basic grid (like a piece of graph paper), where each cell has
Given this XAML: <StackPanel Orientation=Horizontal Grid.Row=1 Grid.Column=0 Margin=5> How can I assign the Grid.Row
Given a grid of nxn squares, where each square has an id, the first(top
Consider that we are given an isometric grid (consider something like Diablo) of tiles.
As I understood , The property grid is given an object which it can
Given an array of 81 elements (meant to represent a 9x9 grid) how can
Suppose that we are given an m x n grid of zeros and ones
Given that every grid, combobox, checkboxlist and in general multi row control supports binding
I have grid of images, when the mouse is over any given image a
I ve data in the JSON format given below,need to populate the slick grid

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.