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:

  1. For each triangle :
    1. Compute centroid for triangle
    2. For each tetrahedron
      1. Calculate the barycentric coordinates of with respect to
      2. For , if , mark the triangle corresponding to .
  2. Take the union of all marked triangles
  3. 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:

  1. For each triangle :
    1. Construct a set of samples points lying in
    2. For each point and tetrahedron
      1. Calculate the barycentric coordinates of with respect to
      2. For , if , mark the triangle corresponding to .
  2. Take the union of all marked triangles
  3. Fill holes

Running this code (without hole filling) gives the following result (after 10 minutes):

center

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?