From: "Steven_Lord" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Optimizing a selection problem
Date: Sun, 10 Oct 2010 01:37:54 -0400
Organization: MathWorks
Lines: 40
Message-ID: <i8rjfi$cor$>
References: <i8p0oc$fbe$>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
X-Trace: 1286689074 13083 (10 Oct 2010 05:37:54 GMT)
NNTP-Posting-Date: Sun, 10 Oct 2010 05:37:54 +0000 (UTC)
In-Reply-To: <i8p0oc$fbe$>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: comp.soft-sys.matlab:677195

"Jordan " <> wrote in message 
> Dear Matlab users,
> I am new to optimization problems and hope that someone may be able to 
> help me find a solution.
> I have two groups of 100 people, all of whom have two features (age and 
> education). I would like to match up each individual with a similar person 
> from the other group.
> It is simple enough to start by picking the best matches from the group, 
> but of course you are punished for this with bad pairings once you get to 
> the bottom of the pool with ill-fitting leftovers. Optimizing pairings 
> across the entire group for the minimum overall difference in age and 
> education is a difficult problem that I need Matlab to solve.
> Can anyone point me towards an appropriate function or algorithm? The 
> optimization toolbox seems to be geared towards continuous functions, 
> whereas this is quite a different problem. Sampling the entire set of 
> possibilities does not seem practical owing to large combinatorials.

This sounds to me like the assignment variety of the (mathematical) marriage 

There are probably implementations of the Hungarian algorithm on the File 
Exchange; if not it's not that difficult an algorithm to implement, if I 
remember correctly.

Steve Lord
comp.soft-sys.matlab (CSSM) FAQ:
To contact Technical Support use the Contact Us link on