Interesting problem
From: likesh (luka_at_nogo.si)
Date: 03/23/04
- Next message: David C. Ullrich: "Re: Can all clauses be represented as Horn Clauses?"
- Previous message: Stormbringer: "Re: Graph Theory - bipartite graph problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 23 Mar 2004 13:23:50 +0100
Hello,
I'm trying to figure more appropriate way of solving this interesting
problem.
Problem is:
You have n number of integers (more than 200000) arranged in a sequence. Not
necesseraly all different.
You also have a relation which describes proper sequence of this integers.
Example: you have numbers 1,2,3,4,5,6. Relation is (6<1), (3<2). It means 6
is smaller than 1, 3 is smaller than 2.
It also means that (1<2), (1<3).... ((6<1),(3<2) are just exceptions). If
there is an 'conflict' in sequence with the relation,cost is calculated.
if numb. are arranged in sequence: 1,2,3,4,5,6 this means (6<1) and (3<2)
are in conflict with the relation. Cost of one conflict is calculated as:
(index(high)-index(low)^2. In this case is C= (6-1)^2+(3-2)^2 = 26.
Better solution would be: 1 3 2 6 4 5: Conflicts are: (6<1),(4<6),(5<6).
Cost is C= (4-1)^2+(5-4)^2+(6-4)^2=14.
I have to find an permutation of sequence with the lowest cost in shortest
time. (not necesseraly optimum cost)
I've tried to solve this with checking many (just moving numbers and
calculating cost..) different permutations, but it is very time consuming
algorthm . Although i found out that ordering them from smallest to highest
helps.
Any ideas what kind of procedures i should look into? Any other ideas? Thank
you.
regards
- Next message: David C. Ullrich: "Re: Can all clauses be represented as Horn Clauses?"
- Previous message: Stormbringer: "Re: Graph Theory - bipartite graph problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|