Questions tagged [square-grid]
The square-grid tag has no summary.
41 questions
1 vote
0 answers
47 views
Embed graph with fixed-length edges on a square grid
I have a Python program that receives a 2D square grid-based data, converts it to a graph, does some transformations and then it should embed the resulting graph back on a grid and output it. Any ...
1 vote
2 answers
94 views
Finding two disjont longest possible vertical or horizontal lines in 2D matrix with non-usable cells
The problem is to find two disjont longest possible (but with equal length) horizontal or vertical lines in given 2D matrix, where some cells are excluded from use. The disjont means that any cell ...
2 votes
1 answer
177 views
Minimum Cell Changes to Ensure Unique Numbers in Each Row and Column of an $ n \times n $ Table
We have an $ n \times n $ table, and in each cell of the table, there is a number from $1$ to $ 2n $. We want to change the numbers in some of the cells and replace them with other numbers from $1$ to ...
0 votes
1 answer
76 views
Combining chunks on an infinite grid into regions
I am working on an floorplan application where I save elements on an infinite grid in a sparse manner. Specifically, I have the following Python class representing a sparse grid (basically a ...
0 votes
1 answer
167 views
Detect contour from point grid
Suppose we have a grid of points (which can also be very dense 10000x10000) like the one in the figure in which the points are marked with two different colors. What is the best algorithm from a ...
3 votes
2 answers
313 views
Maximize enclosed area of given figures on 2d grid
I need to solve an optimization problem for a given set of polyominoes, for example the five Tetrominoes known from Tetris. The goal is to place each one of the figures on the 2d grid, so the area ...
0 votes
0 answers
85 views
Display XY data on computer
I would like to experiment with displaying the output of an analog to digital converter on computer. Samples of the ADC output would determine the intensity of one pixel. The input to the ADC is an ...
1 vote
1 answer
111 views
Recreate a spanning tree in a grid graph given vertex descriptions
Let's assume I have graph above with spanning tree pointed out by blue edges. Vertex at position (1,1) (row 1, column 1) is connected to the bottom vertex and has degree 1. Vertex at position (4,2) (...
0 votes
0 answers
119 views
How to reposition an undirected weighted graph on a 2D grid where strongly connected nodes stay together?
I have an undirected fully-connected weighted graph of $n$ nodes, where $n=m\times m$. I want to visualize this graph on an $m$ x $m$ 2D grid. My goal is to place nodes connected with edges of higher ...
1 vote
1 answer
56 views
Condition for detection of collision in an algorithmic problem
While solving This algorithm problem I was unable to come up with condition for the collision to occur ( other than the naive O(n^2) algorithm ) on reading the explanation they say Let’s deepen the ...
4 votes
0 answers
96 views
Algorithm to find equivalent classes of homotopic pathes on a grid with obstacles
Given a $n \times n$ grid with some walls and two cells $a$ and $b$, I want to compute the non-homotopics paths from $a$ to $b$ on this grid. A path is a sequence of adjacent cells (diagonal does not ...
0 votes
1 answer
1k views
Maximum flow on a n ×n grid
I am currently dealing with a network flow problem and I am trying to find some similar solved problems to help me formulate my solution. The text is: You are the owner of a large chain of franchise ...
1 vote
1 answer
360 views
Algorithm to find the path with minimum bending points on a square grid board
Let's suppose we have a square grid board like the one shown in the picture below: I'm wondering how I can find the path with minimum number of "bending" points (like the ones shown in red) ...
1 vote
1 answer
238 views
SAT formula for connected graphs on the grid
In the answer to an earlier question "SAT algorithm for determining if a graph is disjoint" a formula is constructed that is satisfiable iff a given graph is connected. The formula uses a ...
1 vote
0 answers
42 views