Information Technology Reference
In-Depth Information
val1 = Min[val1
,
val2]
,
val1 = Min[val1
,
val2]
,
Optimize`NMinimizeDump`vec = vec1];
Optimize`NMinimizeDump`vec = vec1];
Optimize`NMinimizeDump`vec = vec1];
If[val1
<
best
,
If[val1
<
best
,
If[val1
<
best
,
best = val1;
best = val1;
best = val1;
vec1 = bestvec = Optimize`NMinimizeDump`vec;
vec1 = bestvec = Optimize`NMinimizeDump`vec;
vec1 = bestvec = Optimize`NMinimizeDump`vec;
If[printFlag
,
If[printFlag
,
If[printFlag
,
Print[“new low ”
,
++indx
,
“
Print[“new low ”
,
++indx
,
“
Print[“new low ”
,
++indx
,
“
{
{
{
it erat ion
,
elapsedtime
,
newvalue
it erat ion
,
elapsedtime
,
newvalue
it erat ion
,
elapsedtime
,
newvalue
}
}
}
”
,
”
,
”
,
{
{
{
i
,
TimeUsed[]
−
i
,
TimeUsed[]
i
,
TimeUsed[]
−
−
tt
,
best
tt
,
best
tt
,
best
}
}
]];tt = TimeUsed[]; ];
}
]];tt = TimeUsed[]; ];
]];tt = TimeUsed[]; ];
]]];
val1];
val1];
bestvec = Range[len];
val1];
bestvec = Range[len];
best = To tal[Flatten[mat1
bestvec = Range[len];
best = To tal[Flatten[mat1
best = To tal[Flatten[mat1
∗
∗
∗
mat2]];
mat2]];
mat2]];
{
{
{
nmin
,
vals
nmin
,
vals
nmin
,
vals
= NMinimize[objfunc[vars]
,
rnges
,
MaxIterations
}
}
}
= NMinimize[objfunc[vars]
,
rnges
,
= NMinimize[objfunc[vars]
,
rnges
,
MaxIterations
MaxIterations
→
→
→
it
,
Compiled
it
,
Compiled
it
,
Compiled
→
→
→
False
,
StepMonitor :
False
,
StepMonitor :
False
,
StepMonitor :
→
→
→
i
++
,
i
++
,
i
++
,
Method
Method
Method
→{
→{
→{
DifferentialEvolution
,
SearchPoints
DifferentialEvolution
,
SearchPoints
DifferentialEvolution
,
SearchPoints
→
→
→
sp
,,
sp
,,
sp
,,
CrossProbability
CrossProbability
CrossProbability
→
→
→
cpScalingFactor
cpScalingFactor
cpScalingFactor
→
→
→
sc
,
PostProcess
sc
,
PostProcess
sc
,
PostProcess
→
→
→
False
False
False
}
}
}
];
];
];
Clear[objfunc2];
Clear[objfunc2];
{
{
{
To tal[Flatten[mat1
To tal[Flatten[mat1
To tal[Flatten[mat1
permuteMatrix[mat2
,
Ordering[bestvec]]]]
,
Ordering[bestvec]
∗
∗
∗
permuteMatrix[mat2
,
permuteMatrix[mat2
,
Ordering[bestvec]]]]
,
Ordering[bestvec]
Ordering[bestvec]]]]
,
Ordering[bestvec]
}
}
}
]
]
]
We now show a run with printout included. The parameter settings are, as usual, based
on shorter tuning runs.
Timing[QAP4[mat1
,
mat2
,.
08
,
400
,
320
,.
4
,
4
,.
4
,
False
,
True]]
locally improved
{
4838
,
4788
}
new low 1
{
iteration, elapsed time, new value
}{
0
,
0
.
280017
,
4788
}
locally improved
{
4788
,
4724
}
new low 2
{
iteration, elapsed time, new value
}{
0
,
0
.
012001
,
4724
}
locally improved
{
4724
,
4696
}
new low 3
{
iteration, elapsed time, new value
}{
0
,
0
.,
4696
}
locally improved
{
4696
,
4644
}
new low 4
{
iteration, elapsed time, new value
}{
0
,
0
.,
4644
}
locally improved
{
4644
,
4612
}
{
}{
0
,
0
.
240015
,
4612
}
new low 5
iteration, elapsed time, new value
{
4612
,
4594
}
locally improved
{
}{
0
,
0
.
100006
,
4594
}
new low 6
iteration, elapsed time, new value
locally improved
{
4594
,
4566
}
new low 7
{
iteration, elapsed time, new value
}{
0
,
0
.
004
,
4566
}
locally improved
{
4566
,
4498
}
new low 8
{
iteration, elapsed time, new value
}{
0
,
0
.,
4498
}
locally improved
{
4498
,
4370
}
new low 9
{
iteration, elapsed time, new value
}{
0
,
0
.
972061
,
4370
}
locally improved
{
4370
,
4348
}
new low 10
{
iteration, elapsed time, new value
}{
0
,
0
.
004
,
4348
}
locally improved
{
4348
,
4322
}
new low 11
{
iteration, elapsed time, new value
}{
10
,
21
.
3933
,
4322
}
Search WWH ::
Custom Search