"; } ?> None

TORSCHE Scheduling
Toolbox for Matlab

Name

qap — solves the Quadratic Assignment Problem

Synopsis


    [MAP,FMIN,STATUS,EXTRA] = QAP(DISTANCESGRAPH,FLOWSGRAPH)

Description

The problem is defined using two graphs: graph of distances DISTANCESGRAPH and graph of flows FLOWSGRAPH.

A nonempty output is returned if a solution is found. The first return parameter MAP is the optimal mapping of nodes to locations. FMIN is optimal value of the objective function. Status of the optimization is returned in the third parameter STATUS (1-solution is optimal). The last parameter EXTRA is a data structure containing the field TIME - time (in seconds) used for solving.

Example

 >> D = [0 1 1 2 3; ... % distances matrix
         1 0 2 1 2; ...
         1 2 0 1 2; ...
         2 1 1 0 1; ...
         3 2 2 1 0];
 >> F = [0 5 2 4 1; ... % flows matrix
         5 0 3 0 2; ...
         2 3 0 0 0; ...
         4 0 0 0 5; ...
         1 2 0 5 0];
 >> distancesg=graph(1*(D~=0));                      %Create graph of distances
 >> distancesg=matrixparam2edges(distancesg,D,1,0);  %Insert distances into the graph
 >> flowsg=graph(1*(F~=0));                          %Create graph of flow
 >> flowsg=matrixparam2edges(flowsg,F,1,0);          %Insert flows into the graph
 >> qap(distancesg,flowsg);
Webmaster - Jan Dvořák (2004 - 2024)