Following the source ...
distance_transform_edtends with code , starting with the following helpful comment:
/* Exact euclidean feature transform, as described in: C. R. Maurer,
Jr., R. Qi, V. Raghavan, "A linear time algorithm for computing
exact euclidean distance transforms of binary images in arbitrary
dimensions. IEEE Trans." PAMI 25, 265-270, 2003. */
int NI_EuclideanFeatureTransform(PyArrayObject* input,
PyArrayObject *sampling_arr,
PyArrayObject* features)
And ends with a function that looks like brute force calculation. But here the algorithm is also well described in the main documentation and in other places that appear in the main search. distance_transform_bf