-1

Say we wanna compute the TSP for a given, complete graph G with V vertices and E edges (by complete I mean : every vertex is connected with every other vertex).


I'll try to ask the question again. Hopefully I'll get it right this time. My goal is simple :
For this complete graph G, how does one filter out some edges that will probably not be in the graph?

Fatso
  • 1,278
  • 16
  • 46
  • 1
    Pre-processing won't save you any time since TSP is an NP-complete problem. Was there some other goal you had in mind? – chrisaycock Jan 05 '12 at 15:19
  • 1
    What is the context in which you're trying to do this "pre-processing", and what does sorting have to do with this? – NPE Jan 05 '12 at 15:20
  • 1
    Time isn't the issue, memory is ... I'm using the MST heuristic and am traversing the MST in a sorted way. If you want more details, I can add those to the post, but that's not the point of the question. I'm just interested in pre-processing techniques. – Fatso Jan 05 '12 at 15:23
  • 1
    What is the purpose of cutting of edges? TSP is defined on complete graphs, so we usually do the other way around: add edges to the graph with `w=infinity`, to make it fit the problem. – amit Jan 05 '12 at 15:23
  • 1
    I'm not gonna get into why pre-processing is handy. That is not the question. I simply wanna know under what circumstances one can cut out edges. I don't see why anyone would down-vote this. It's a simple question, probably a lot of you have the answer, though I can't seem to find any pseudo-code by googling. – Fatso Jan 05 '12 at 15:49
  • 1
    Could down-voters please tell me why they think my question is crap? I'm so sorry if I asked a dumb question, but please tell me what is so dumb about it. At least I won't make the same mistake again. – Fatso Jan 05 '12 at 16:23

2 Answers2

2

Keld Helsgaun's implementation of Lin-Kernighan measures the quality of an edge e as [min cost of a 1-tree including e] - [min cost of a 1-tree] (lower is better). See Section 4.1.

fake
  • 36
  • 1
0

There's no efficient way to decide whether an edge will be used in the solution tour. If there were, then by the inherent self-reducibility of the problem you could solve the whole thing in polynomial time by checking whether each edge in turn is part of a solution tour and removing the edge if the answer is no.

Kyle Jones
  • 5,492
  • 1
  • 21
  • 30
  • I'm not talking about removing ALL the edges that are not gonna be on the tour. I'm talking about removing the ones that are too far away. That would already remove a lot of edges, which is enough for me. – Fatso Jan 05 '12 at 17:42
  • You're saying that there must be an easy way to know whether some of the edges are "too far away". I'm saying there isn't any way to know that without doing the same work required to solve the whole problem. – Kyle Jones Jan 05 '12 at 18:05
  • That is actually not true. I've seen pre-processing methods before, I just don't understand them. – Fatso Jan 05 '12 at 18:08
  • Maybe I'm wrong, I'm quite new to this. Anyways, what I really am looking for is a way to remove edges from the complete graph to reduce the amount of memory used. Efficiency is the last thing on my mind. It just needs to reduce memory usage in the complete graph by removing edges. – Fatso Jan 05 '12 at 18:22