Position Optimization

Viewed 154

The Problem:

I have multiple geometric figures which may or may not be connected to each other. Each connection has a value. I want to minimize the connection by repositioning the figures. For better understanding you can imagine it as a undirected graph with multiple nodes:

enter image description here

Instead of searching for the shortest path, i want to reposition the nodes to minimize the sum of all edges. With the constraint that the nodes do not intersect each other. The weight of the edges is not just the euclidic distance from the center. First because in my specific problem the distance is measured from a "center of mass". Second, as i stated before, the nodes can be any geometric firgure. The figures can not be rotated so the only variables are the x,y position of the nodes.

What i have:

I have a collision function which can detect, if the nodes intersect themselves. I have a function, which calculates the sum over all edges based on the position of the nodes.

What i need:

I need a suitable algorithm to minimize the sum of the edges by repositioning the nodes. I don't think there is a greedy algorithm for this problem, beacuse the position of the nodes can block each other. But please correct me. Basically i have a optimization problem with dynamic constraints, which change on every iteration. At the moment i add a very high penalty value to the function, if the figures collide. I do not want to use a neural network. I use python for the calculation. So at the moment i am playing around with the scipy.optimize.minimze function, but i'm not too fimiliar with all these algorithms.

Please ask for clearifaction if necessary.

0 Answers
Related