All Questions
24 questions
1
vote
2
answers
264
views
Closest Pair of Points - Optimizing Code for big sets of points
I'm trying to create an algorithm that finds the closest pair of points (2D) within a set of points. I'm using a divide and conquer method which is explained here Closest Pair of Points Algorithm.
...
3
votes
0
answers
78
views
Python: Algorithm for fast boundings box collision between two large sets of m and n rectangles
AABB: Axis Aligned Bounding Box
ALGORITHM:
Compare m number of AABB to n number of AABB to find if there is a collision between m and n sets.
PROBLEM:
Slow implementation for large number of ...
5
votes
3
answers
220
views
Detect loop in rectilinear path
Given a rectilinear path, find if it has a loop. A rectilinear path is made up of made up of alternating horizontal and vertical segments.
Input => Ordered set of points representing ra ectilinear ...
7
votes
3
answers
3k
views
Determine if a triangle is equilateral, isosceles, or scalene
I've been fiddling around with some easy code challenges and there's one about determining if a triangle is equilateral, isosceles, or scalene.
I've come up with a working solution, but I feel this ...
6
votes
1
answer
944
views
Choosing evenly distributed points from a million points on a sphere
I have \$10^5\$ to \$10^6\$ points on a sphere, and want to choose some points from them which are as close as uniformly distributed as possible. For that reason, I do the following: at each step I ...
6
votes
1
answer
591
views
Searching extreme points of polyhedron
In my Uni, my scientific professor asked me to make some researches about the extreme points of polyhedrals. And I did them. I found that there is still no code in public for searching extreme points ...
6
votes
1
answer
89
views
Optimal algorithm to move a a rope from one position to another
I'm an engineer working with a deformable membrane that is attached to actuators. The goal is to move the membrane from one shape to another, without ripping the membrane. This imposes "neighbor ...
10
votes
2
answers
244
views
Where is the most desolate place in Colorado?
The Story
While flying a plane over the forests of Wisconsin a couple years ago, I thought to myself "If I lost an engine, I would be awfully long way from an emergency landing airport. I wonder ...
5
votes
2
answers
3k
views
Given a list of coordinates check if 4 points make a line
I was doing some preparation for coding interviews and I came across the following question:
Given a list of coordinates "x y" return True if there exists a line ...
12
votes
1
answer
7k
views
2D Bin Packing Algorithm Implementation
I wrote a 2D greedy bin packing algorithm using Python 3.6
Heres a quick summary:
The algorithm consists of two classes (which I will attach at the end of this file along with a link to my github repo)...
5
votes
1
answer
1k
views
Shortest path around a set of points
Problem
I'm trying to get into Python and get a bit familiar with it, so I found a problem online to train. The problem was to find the shortest path around some points, given a set of nodes which ...
6
votes
1
answer
2k
views
Calculate angle between planes
I have written working code calculating the angle between the adjacent planes.
I read subsequently from standart input:
n - amount of triangles,
m - amount of vertices
ind[] - indices of the vertices ...
2
votes
2
answers
508
views
Python Kohonen algorithm
I've tried to implement the Kohonen algorithm using Python and I've managed to do this, but my result is so slow. I want to know if anyone knows how I can improve it.
Objective:
I have to read a file ...
5
votes
2
answers
14k
views
Closest distance between points in a list
In a course I'm doing, I was given the task of finding the closest pair of points among the given points. The program that passed all test cases was the following:
...
8
votes
1
answer
1k
views
Find the nearest point of a given set of points (part 2)
This is a continued discussion from here, and I use new a approach (bounding box/or envelop algorithm) to improve the algorithm efficiency. Any code bugs, algorithm time complexity improvement or ...