Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Transmitter Clusters
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OROBWorld
Transmitter Clusters
Commits
f6e9a42e
Commit
f6e9a42e
authored
3 years ago
by
Paul A. Rubin
Browse files
Options
Downloads
Patches
Plain Diff
Added hot start to first MIP model using heuristic solution. Second MIP model always rejects it.
parent
e4ce60d7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xmtrclusters/XmtrClusters.java
+11
-1
11 additions, 1 deletion
src/xmtrclusters/XmtrClusters.java
with
11 additions
and
1 deletion
src/xmtrclusters/XmtrClusters.java
+
11
−
1
View file @
f6e9a42e
...
@@ -5,6 +5,7 @@ import java.util.Collection;
...
@@ -5,6 +5,7 @@ import java.util.Collection;
import
solvers.GreedyConstruction
;
import
solvers.GreedyConstruction
;
import
solvers.MIPModel
;
import
solvers.MIPModel
;
import
solvers.MIPModel2
;
import
solvers.MIPModel2
;
import
solvers.PairSwap
;
/**
/**
* XmtrClusters experiments with solutions to a problem of clustering
* XmtrClusters experiments with solutions to a problem of clustering
...
@@ -41,14 +42,23 @@ public final class XmtrClusters {
...
@@ -41,14 +42,23 @@ public final class XmtrClusters {
if
(
g
.
isEmpty
())
{
if
(
g
.
isEmpty
())
{
System
.
out
.
println
(
"\nThe greedy heuristic failed."
);
System
.
out
.
println
(
"\nThe greedy heuristic failed."
);
}
else
{
}
else
{
System
.
out
.
println
(
"
\n
Greedy heuristic results:\n"
+
prob
.
report
(
g
));
System
.
out
.
println
(
"Greedy heuristic results:\n"
+
prob
.
report
(
g
));
}
}
System
.
out
.
println
(
""
);
System
.
out
.
println
(
""
);
// Try the swapping heuristic.
long
tl
=
10000
;
// run time limit (ms.)
PairSwap
swap
=
new
PairSwap
(
prob
,
g
,
tl
);
Collection
<
Collection
<
Integer
>>
s
=
swap
.
getSolution
();
System
.
out
.
println
(
"Pairwise swapping results:\n"
+
prob
.
report
(
s
));
System
.
out
.
println
(
""
);
// Create and solve a MIP model.
// Create and solve a MIP model.
double
timeLimit
=
300
;
// time limit in seconds for CPLEX
double
timeLimit
=
300
;
// time limit in seconds for CPLEX
try
{
try
{
MIPModel
mip
=
new
MIPModel
(
prob
);
MIPModel
mip
=
new
MIPModel
(
prob
);
// Add the heuristic solution as a starting solution.
mip
.
hotStart
(
s
);
double
obj
=
mip
.
solve
(
timeLimit
);
double
obj
=
mip
.
solve
(
timeLimit
);
System
.
out
.
println
(
"\nFinal objective value = "
+
obj
);
System
.
out
.
println
(
"\nFinal objective value = "
+
obj
);
// Get and summarize the optimal transmitter clusters.
// Get and summarize the optimal transmitter clusters.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment