The problem seems to be more difficult than I originally thought, so I’ve decided to start by working in 3D and hope the method translates well to 4D.
Problem Statement: Given a 2-complex , find a 2-chain in the tetrahedralization of the unit cube that approximates .
We could try to solve this with an MIP, but I’m not entirely sure on the right objective function. Instead we use a heuristic as we also want to introduce noise anyways.
Idea of a heuristic:
- For each triangle :
- Compute centroid for triangle
- For each tetrahedron
- Calculate the barycentric coordinates of with respect to
- For , if , mark the triangle corresponding to .
- Take the union of all marked triangles
- Fill holes
It creates the general shape, but there a ton of holes many of which are too large to fill. The problem may be that I’m only sampling one point of the triangle. One modification is sample several points:
- For each triangle :
- Construct a set of samples points lying in
- For each point and tetrahedron
- Calculate the barycentric coordinates of with respect to
- For , if , mark the triangle corresponding to .
- Take the union of all marked triangles
- Fill holes
Running this code (without hole filling) gives the following result (after 10 minutes):

Which is rife with holes but is approximately sphere shaped. Maybe with perfect settings this approach would work?
Alternative approach would be some sort of MIP:
where is the current target triangle and is selecting specific triangles which have volume . My concern with this approach is that is very localized, i.e., there is no guarantee that the connection between triangles are shared. Capturing that may require constructing a dual graph:
where
- corresponds to a triangle
- corresponds to two triangle that share an edge
Then we could capture the connection similar to TSP?