473,563 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Measuring Similarity for Assignment Problems

179 New Member
I'm trying to come up with an effective assignment algorithm to allocate nodes to a nearest outlet, where each node should be have a time slot checked against the already allocated nodes for similarity (or even sequentiality to allow effective journey planning throughout a day).

I've currently looked at something called SPA - Simple Parallel Assigning which works out the cost of assigning each node to its nearest and next nearest outlet, and then assigns the one with the greatest cost saving.

The way the similarity would be calculated is

TimeDiff = difference between start/end or end/start time slots between existing node and 'to be assigned' node.
Time = Distance between existing node and 'to be assigned' node

The cost is then:
e^(-TimeDiff + Time) summed for each Node already assigned.

This value is compared to the second nearest outlet to determine the overall cost saving in assigning it.

Unfortunately the algorithm seems fairly slow, and seems to assign nodes in a very unusual way and I'm wondering if anyone can suggest a better way of doing something like this is they know about assignment problems?

Thanks...
Jul 29 '08 #1
7 2004
JosAH
11,448 Recognized Expert MVP
Are those demand nodes D independent in their demand except for their time slots?
Even if only, say sum(D) == Dtotal you can solve your problem using an MCNF
(Minimal Cost Network Flow) solver (which can easily be modelled as an ordinary LP).

kind regards,

Jos
Jul 29 '08 #2
IanWright
179 New Member
Are those demand nodes D independent in their demand except for their time slots?
Even if only, say sum(D) == Dtotal you can solve your problem using an MCNF
(Minimal Cost Network Flow) solver (which can easily be modelled as an ordinary LP).

kind regards,

Jos
Jos, yeah the demand of each node is independent, the time slots want to be loosely grouped to minimise the time you must wait at a node you visit if you're early. I'm basically trying to break a multiple depot problem down into single depot problems to then run a vehicle routing problem solver that I'm going to generate on them. I'm currently not sure whether or not my intended algorithm can cater for multiple depots (using Ant Colony Optimisation but don't have a great understanding of the maths) so thought it best to split it up into two problems.

So in the ideal word, the time slots actually want to be vaguely consecutive so an optimal tour between all the nodes can be generated.

I've not actually heard of a MCNF but it sounds like its actually very similar to my overall aim.
Jul 30 '08 #3
JosAH
11,448 Recognized Expert MVP
VRP (Vehicle Routing Problems) are hell. What I once did was the following:

given an ordinary Transportation Problem with i producers Pi and j demands Dj
add more of each for each, say, hour of the day. Each artificial demand Dj has
the same demand as the original Dj; the same counts for the artificia producers
Pi. The artificial nodes represent the time (and cost) of the real node when its
closed. The added costs represent the waiting time. Also add an extra artificial
Producer Px if needed; make all the transportation costs originating in Px
extremely high.

Now you have an ordinary TP (Transportation Problem) again that can easily
be solved. Simply ignore all the activity from/to artificial nodes. Now you have
a nice crash basis solution for your original VRP.

Of course this trick doesn't work well for very narrow time slots.

kind regards,

Jos
Jul 30 '08 #4
IanWright
179 New Member
VRP (Vehicle Routing Problems) are hell. What I once did was the following:

given an ordinary Transportation Problem with i producers Pi and j demands Dj
add more of each for each, say, hour of the day. Each artificial demand Dj has
the same demand as the original Dj; the same counts for the artificia producers
Pi. The artificial nodes represent the time (and cost) of the real node when its
closed. The added costs represent the waiting time. Also add an extra artificial
Producer Px if needed; make all the transportation costs originating in Px
extremely high.

Now you have an ordinary TP (Transportation Problem) again that can easily
be solved. Simply ignore all the activity from/to artificial nodes. Now you have
a nice crash basis solution for your original VRP.

Of course this trick doesn't work well for very narrow time slots.

kind regards,

Jos
Hmm, I *think* I follow what you are saying, but I think I'll be all sorted for the VRP problem. I've worked on something recently for a company and am aiming to produce a slicker version myself so am just thinking about all the pitfalls from before and trying to figure out how to optimise them. Unfortunately I'm not a heavy algorithm person so following the principles of what is going on and what might cause it to break is kinda tricky.

At the moment my biggest hurdles are to improve the initial splitting of the problem so I can solve each outlet separately with a set of nodes to visit which is what I was asking about.

Once I've got that I need to consider if I can select vehicles to use in a more sensible way rather than sequentially (try to choose the best based on vehicle capacity etc.) and hope that pheremones save this data correctly.

Finally I need to turn a single day solver into a multi-day solver, carrying over an unvisited nodes to the next day to try to visit them then instead.

Manage to get all these sorted and I should be able to produce an MDCVRPTW (multi depot capacitated vehicle routing problem with time windows).. bit of a mouthful.
Jul 30 '08 #5
JosAH
11,448 Recognized Expert MVP
At the moment my biggest hurdles are to improve the initial splitting of the problem so I can solve each outlet separately with a set of nodes to visit which is what I was asking about.
Don't go that way; it cripples the quality of your solution too much. You have
multiple outlets (P producers) and multiple stores (D demands). They can all
be served from several outlets serving multiple stores. If you chop up the problem
beforehand you severly reduce the quality of your solution.

Manage to get all these sorted and I should be able to produce an MDCVRPTW (multi depot capacitated vehicle routing problem with time windows).. bit of a mouthful.
Been there, done that; it is a mess. The best experience I had was using an
'incremental solver' i.e given a 'best' solution sofar, add another commodity such
that the total costs rise minimally. Afterwards a local search could optimize the
solution a bit further.

kind regards,

Jos

ps. it's a very interesting problem I admit.
Jul 30 '08 #6
IanWright
179 New Member
Don't go that way; it cripples the quality of your solution too much. You have
multiple outlets (P producers) and multiple stores (D demands). They can all
be served from several outlets serving multiple stores. If you chop up the problem
beforehand you severly reduce the quality of your solution.
It can do yes, but on the flip side it can save massively the amount of time you spend processing... Maybe you're right and I'll take a look at doing it without and see if the algorithm I'm using can handle it.

Maybe I'll send it your way sometime for you to take a look at! :D
[/quote]
Jul 31 '08 #7
JosAH
11,448 Recognized Expert MVP
It can do yes, but on the flip side it can save massively the amount of time you spend processing... Maybe you're right and I'll take a look at doing it without and see if the algorithm I'm using can handle it.
About the additional processing: all true but dividing your problem up in several
single depot problems might, mathematically speaking generate deep 'cuts' in
your problem space and exclude (near) optimal solutions because they were
cut away from your problem space.

I once solved this 'multi depot capacitated vehicle routing with time slots problem'
once for an animal fodder production and transportation facility; before they did
it as you suggested. Regularly they found they had the fodder at one of their
factories, they had empty trucks, large enough, waiting at the gate, but the
order bill wanted the order to be handled by another outlet that used to be totally
empty at that time. Effectively spreading those orders over several outlets
really pays back although it is a terrible problem to solve even half decently ;-)

kind regards,

Jos
Jul 31 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

23
3208
by: Paul Rubin | last post by:
OK, I want to scan a file for lines matching a certain regexp. I'd like to use an assignment expression, like for line in file: if (g := re.match(pat, line)): croggle(g.group(1)) Since there are no assignment expressions in Python, I have to use a temp var. That's a little more messy, but bearable:
5
1767
by: Charles Law | last post by:
Hi folks Not really a .NET question, but I always think this is a good place to ask. Does anyone have a favourite algorithm for determining the similarity of, or difference between two strings? I'm looking for something that could be considered to be quite reliable. I have Googled quite extensively, and there is a lot on this subject,...
8
1907
by: ben | last post by:
hello, i'm trying to answer a "prove an upper bound on the number of machine instructions required to process M connections on N objects" exercise from an algorithms book. i don't understand a very basic detail of how i should go about answering the exercise. here's a simplified example question and example programme to hopefully get at...
0
1543
by: Anibal Acosta | last post by:
Somebody know an algorithm for determine the similarity between two string for example: string 1: "Hello what is your name?, where are you from?" string 2: "Hello man, where are you from?" In this case I think that this two string has 75% of similarity. However, if you know an algorithm that do that I'll appreciate very very
0
1126
by: himoundary | last post by:
hi all i am using microsoft speech sdk (sapi 5.1). i have the following requirements: 1) i need to compare current input sound (through mic) with recorded sound file (say .wav). based of this, i need a measure of similarity or correlation between the two sounds (live input from mic and recorded ..wav sound). a score indicating the...
34
7142
by: Chris | last post by:
Is there ever a reason to declare this as if(*this == rhs) as opposed to what I normally see if(this == &rhs) ?
5
2009
by: subramanian | last post by:
Consdier the following program: #include <stdio.h> struct typeRecord { int id; char str; } records = { {0, "zero"}, {1, "one"},
12
6232
by: hweekuan | last post by:
hi, it seems i can't assign the const variable u in class A, one way to solve the problem may be to build a copy constructor. however, why does C++ or vector class not like this code? my g++ is: gcc version 4.0.1 (Apple Inc. build 5465). thanks for the help. summary of compile error: --------------------------------------- cpp.C:4:...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7885
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7638
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.