Skip to content
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="crypto.cs" /> <Compile Include="crypto.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="cscvrptw.cs" /> <Compile Include="cscvrptw.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="csdiet.cs" /> <Compile Include="csdiet.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="csflow.cs" /> <Compile Include="csflow.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -106,19 +106,24 @@ public class CsIntegerProgramming ...@@ -106,19 +106,24 @@ public class CsIntegerProgramming
static void Main() static void Main()
{ {
Console.WriteLine("---- Integer programming example with GLPK ----"); Console.WriteLine("---- Integer programming example with GLPK ----");
RunIntegerProgrammingExample("GLPK_MIXED_INTEGER_PROGRAMMING"); RunIntegerProgrammingExample("GLPK");
Console.WriteLine("---- Linear programming example with CBC ----"); Console.WriteLine("---- Linear programming example with CBC ----");
RunIntegerProgrammingExample("CBC_MIXED_INTEGER_PROGRAMMING"); RunIntegerProgrammingExample("CBC");
Console.WriteLine("---- Linear programming example with SCIP ----"); Console.WriteLine("---- Linear programming example with SCIP ----");
RunIntegerProgrammingExample("SCIP_MIXED_INTEGER_PROGRAMMING"); RunIntegerProgrammingExample("SCIP");
Console.WriteLine("---- Linear programming example with SAT ----");
RunIntegerProgrammingExample("SAT");
Console.WriteLine( Console.WriteLine(
"---- Integer programming example (Natural API) with GLPK ----"); "---- Integer programming example (Natural API) with GLPK ----");
RunIntegerProgrammingExampleNaturalApi("GLPK_MIXED_INTEGER_PROGRAMMING"); RunIntegerProgrammingExampleNaturalApi("GLPK");
Console.WriteLine( Console.WriteLine(
"---- Linear programming example (Natural API) with CBC ----"); "---- Linear programming example (Natural API) with CBC ----");
RunIntegerProgrammingExampleNaturalApi("CBC_MIXED_INTEGER_PROGRAMMING"); RunIntegerProgrammingExampleNaturalApi("CBC");
Console.WriteLine( Console.WriteLine(
"---- Linear programming example (Natural API) with SCIP ----"); "---- Linear programming example (Natural API) with SCIP ----");
RunIntegerProgrammingExampleNaturalApi("SCIP_MIXED_INTEGER_PROGRAMMING"); RunIntegerProgrammingExampleNaturalApi("SCIP");
Console.WriteLine(
"---- Linear programming example (Natural API) with SAT ----");
RunIntegerProgrammingExampleNaturalApi("SAT");
} }
} }
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="csintegerprogramming.cs" /> <Compile Include="csintegerprogramming.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="csknapsack.cs" /> <Compile Include="csknapsack.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -18,6 +18,8 @@ public class CsLinearProgramming ...@@ -18,6 +18,8 @@ public class CsLinearProgramming
{ {
private static void RunLinearProgrammingExample(String solverType) private static void RunLinearProgrammingExample(String solverType)
{ {
Console.WriteLine($"---- Linear programming example with {solverType} ----");
Solver solver = Solver.CreateSolver("IntegerProgramming", solverType); Solver solver = Solver.CreateSolver("IntegerProgramming", solverType);
if (solver == null) if (solver == null)
{ {
...@@ -96,6 +98,9 @@ public class CsLinearProgramming ...@@ -96,6 +98,9 @@ public class CsLinearProgramming
private static void RunLinearProgrammingExampleNaturalApi( private static void RunLinearProgrammingExampleNaturalApi(
String solverType, bool printModel) String solverType, bool printModel)
{ {
Console.WriteLine(
$"---- Linear programming example (Natural API) with {solverType} ----");
Solver solver = Solver.CreateSolver("IntegerProgramming", solverType); Solver solver = Solver.CreateSolver("IntegerProgramming", solverType);
if (solver == null) if (solver == null)
{ {
...@@ -157,20 +162,12 @@ public class CsLinearProgramming ...@@ -157,20 +162,12 @@ public class CsLinearProgramming
static void Main() static void Main()
{ {
Console.WriteLine("---- Linear programming example with GLOP ----"); RunLinearProgrammingExample("GLOP");
RunLinearProgrammingExample("GLOP_LINEAR_PROGRAMMING"); RunLinearProgrammingExample("GLPK_LP");
Console.WriteLine("---- Linear programming example with GLPK ----"); RunLinearProgrammingExample("CLP");
RunLinearProgrammingExample("GLPK_LINEAR_PROGRAMMING");
Console.WriteLine("---- Linear programming example with CLP ----"); RunLinearProgrammingExampleNaturalApi("GLOP", true);
RunLinearProgrammingExample("CLP_LINEAR_PROGRAMMING"); RunLinearProgrammingExampleNaturalApi("GLPK_LP", false);
Console.WriteLine( RunLinearProgrammingExampleNaturalApi("CLP", false);
"---- Linear programming example (Natural API) with GLOP ----");
RunLinearProgrammingExampleNaturalApi("GLOP_LINEAR_PROGRAMMING", true);
Console.WriteLine(
"---- Linear programming example (Natural API) with GLPK ----");
RunLinearProgrammingExampleNaturalApi("GLPK_LINEAR_PROGRAMMING", false);
Console.WriteLine(
"---- Linear programming example (Natural API) with CLP ----");
RunLinearProgrammingExampleNaturalApi("CLP_LINEAR_PROGRAMMING", false);
} }
} }
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="cslinearprogramming.cs" /> <Compile Include="cslinearprogramming.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="csls_api.cs" /> <Compile Include="csls_api.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="csrabbitspheasants.cs" /> <Compile Include="csrabbitspheasants.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="cstsp.cs" /> <Compile Include="cstsp.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="curious_set_of_integers.cs" /> <Compile Include="curious_set_of_integers.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="debruijn.cs" /> <Compile Include="debruijn.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="discrete_tomography.cs" /> <Compile Include="discrete_tomography.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="divisible_by_9_through_1.cs" /> <Compile Include="divisible_by_9_through_1.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="dudeney.cs" /> <Compile Include="dudeney.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="einav_puzzle2.cs" /> <Compile Include="einav_puzzle2.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="eq10.cs" /> <Compile Include="eq10.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
<ItemGroup> <ItemGroup>
<Compile Include="eq20.cs" /> <Compile Include="eq20.cs" />
<PackageReference Include="Google.OrTools" Version="7.7.*" /> <PackageReference Include="Google.OrTools" Version="7.8.*" />
</ItemGroup> </ItemGroup>
</Project> </Project>