3

Sorry for the complex name - it's kind of well-deserved. Let me present the problem.

Context: I have a type of location network that I want to do some partitioning with.

Definition of Problem: I have an undirected weighted graph G = {V,E,w} with a set of vertexes V, edges E, and edge-weights W. Edges exist between all vertexes in V.

Now, I have cycles C = {C1...CN} of sizes |C1|...|CN| s.t. the sum of |C1|...|CN| is equal to the total number of vertexes |V|. The score of a cycle Ci is then the sum of weights of all the edges involved in the path.

Finally, here's the objective: I would like to fit all the cycles of C in G in such a way that their combined scores is maximal with the constraint that no cycles in C intersect with each other.

So in layman terms: I'd like to fill a graph with cycles of defined length s.t. the global weight is optimal.

My take on this problem: This problem is at least NP-hard because it can be reduced to something like a packing problem or Hamiltonian cycle.

The optimal solution is likely not even pseudo-polynomial. I've tried formulating the problem in several different ways (graphs) and it always results in state explosions so a tractable 2D dynamic programming approach is likely not possible (correct me if I am wrong).

So it appears that I probably have to use an approximation approach. One thing that comes to mind is to just try to find the Hamiltonian path of the entire graph using its own approximation approaches. Then the next step would be to find the locations to "cut" the local-optimal Hamiltonian path to produce the cycles. There are |C|!*|V| ways to arrange these "cut-sites". The factorial comes from the permutations of the ordering of these cycles and the |V| comes from the total number of start positions. Even with pruning (i.e. there are cycles of same sizes), this is still intractable for large |C|'s. I'd say brute force is okay for small |C|'s and a hill-climbing approach would be needed for larger |C|'s to get an approximation of a local-optimal arrangement.

Anyhow, what do you guys think?

Emil Vikström
  • 90,431
  • 16
  • 141
  • 175
Some Newbie
  • 1,059
  • 3
  • 14
  • 33

1 Answers1

0

According to David Speyer's comment here, I think you're looking at the (polynomially solvable in |V|) linear assignment problem.

If I'm understanding you correctly, you are trying to optimize a function over the space of sets of cycles that partition your nodes. As I understand it, you aren't fixing the number of cycles, or the lengths of any single one: your only constraint is that they are disjoint and include every node.

If so, each such set of cycles can be identified exactly with a single permutation of nodes. You seem to be therefore optimizing over the space of node permutations.

Let's call your objective function (the sum of the edge weights in the current permutation) f. f is a function of node permutations, but we are free to choose how those permutations are represented. If we choose a matrix broken into |V| vectors, then f is the sum of |V| dot products and so is linear, fitting the assignment problem's criteria.

EDIT

The questions about possibly having to find Hamiltonian cycles can resolved by recalling that every pair of nodes has a connecting edge. Complete graphs are a degenerate case for that problem: any ordering of all nodes is a Hamiltonian cycle.

If C is the weight matrix and P is a permutation matrix, then the cost function could be written in matlab/octave syntax as f(P) = sum(sum(C .* P)). Here .* is the pair-wise product operator, which results in a matrix that is then summed up over both dimensions to get a scalar. Since .* doesn't have a name (that I know of) in classical linear algebra, we could instead write it as a sum of dot products. Each dot product would be over a row of C and a row of P (not a column.)

The Hungarian algorithm is one of the polytime algorithms linked to on the assignment problem's Wikipedia page.

Community
  • 1
  • 1
phs
  • 10,687
  • 4
  • 58
  • 84
  • Are you sure? Because in the case where there is only 1 cycle, it is the edge-weighted Hamiltonian path problem that is NP-hard and shouldn't be polytime unless P = NP. Let's say you are correct and that my objective function can, in fact be represented as a system of linear equation, I would probably need some help formulating that. For reference, my objective function for a simple case of 1 cycle with permutation v1, v3, v4, v5, v2 would be e(v1,v3) + e(v3,v4) + e(v4,v5) + e(v5,v2) + e(v2,v1), where v corresponds to vertex and e corresponds to e. Also, what's name of the polytime algo? – Some Newbie May 13 '12 at 07:16
  • In response to your edit. I was not referring to the generic Hamiltonian path problem. Rather, I was referring to the *maximum weighted* Hamiltonian path problem, which is also NP-hard.
    Edit: I just realized this "maximum weighted Hamiltonian path problem" is actually the infamous traveling salesman problem /facepalm). But yeah, my assertion is that the traveling salesman problem is solved for the individual subgraphs (i.e. splice out the cycles). If what David said is right in the post you linked me to, then the linear assignment approach is no longer applicable. Am I correct?
    – Some Newbie May 14 '12 at 04:48
  • As for your cost function, let's go step by step. Let's assume `C = [1,2,1,1;2,2,1,1;1,1,1,2;1,1,2,1]` and `P = [0,0,1,0;1,0,0,0;0,0,0,1;0,1,0,0]`. Then P is really the permutation `{v3,v1,v4,v2}`. If we apply `sum(sum(C .* P))`, then instead of getting `e(3,1) + e(1,4) + e(4,2) + e(2,3)`, we get `e(3,1) + e(4,2) + e(3,4) + e(1,2)`. Also, I don't think it also factors in the concept of optimizing over M potentially different length cycles. At least I don't see how that can be presented in this linear equation (or any linear equation). Maybe I have missed something? – Some Newbie May 14 '12 at 05:35