I want find a set of paths through a graph that maximise flow and minimise cost set on each Edge. However, I have an additional constraint where each Vertex can only be visited once.
Mathematica has the function FindMinimumCostFlow for finding this, but I cannot figure out how to limit the solution to unique vertices only. Please help.
Example code:
costs = Range[24];
g = Graph[
{0 -> 11, 0 -> 12, 0 -> 13,
11 -> 21, 11 -> 22, 11 -> 23, 12 -> 21, 12 -> 22, 12 -> 23,
13 -> 21, 13 -> 22, 13 -> 23, 21 -> 31, 21 -> 32, 21 -> 33,
22 -> 31, 22 -> 32, 22 -> 33, 23 -> 31, 23 -> 32, 23 -> 33,
31 -> 4, 32 -> 4, 33 -> 4}, EdgeCost -> costs, VertexLabels -> "Name"];
FindMinimumCostFlow[g, 0, 4, "EdgeList"];
HighlightGraph[g, Graph[%], GraphHighlightStyle -> "Thick"]
but ideally i would like to get
Motivation: This is for reconstructing particle trajectories from video data. Each Vertex corresponds to a particle detection at a given frame and position.