File tree 1 file changed +21
-14
lines changed
1 file changed +21
-14
lines changed Original file line number Diff line number Diff line change 2
2
"cells" : [
3
3
{
4
4
"cell_type" : " code" ,
5
- "execution_count" : 1 ,
5
+ "execution_count" : 16 ,
6
6
"metadata" : {},
7
7
"outputs" : [
8
8
{
9
9
"data" : {
10
10
"text/html" : [
11
- " Installing package Google.OrTools................. done!"
11
+ " Installing package Google.OrTools..done!"
12
12
]
13
13
},
14
14
"metadata" : {},
27
27
"source" : [
28
28
" #r \" nuget:Google.OrTools\"\n " ,
29
29
" \n " ,
30
- " using Google.OrTools.LinearSolver;"
30
+ " using Google.OrTools.LinearSolver;\n " ,
31
+ " using System.Linq; "
31
32
]
32
33
},
33
34
{
73
74
},
74
75
{
75
76
"cell_type" : " code" ,
76
- "execution_count" : 2 ,
77
+ "execution_count" : 3 ,
77
78
"metadata" : {},
78
79
"outputs" : [],
79
80
"source" : [
82
83
},
83
84
{
84
85
"cell_type" : " code" ,
85
- "execution_count" : 3 ,
86
+ "execution_count" : 4 ,
86
87
"metadata" : {},
87
88
"outputs" : [],
88
89
"source" : [
113
114
},
114
115
{
115
116
"cell_type" : " code" ,
116
- "execution_count" : 4 ,
117
+ "execution_count" : 25 ,
117
118
"metadata" : {},
118
119
"outputs" : [],
119
120
"source" : [
132
133
" // The objective value of the solution.\n " ,
133
134
" Console.WriteLine(\" Optimal objective value = \" + solver.Objective().Value());\n " ,
134
135
" \n " ,
135
- " // The value of each variable in the solution.\n " ,
136
- " foreach (var v in solver.variables())\n " ,
137
- " { Console.WriteLine($\" {v.Name()} : {v.SolutionValue()} \" ); };\n " ,
136
+ " //Improved solution display\n " ,
137
+ " display(solver.variables().Select(a => new { Name = a.Name(), Value = a.SolutionValue() }));\n " ,
138
138
" }"
139
139
]
140
140
},
141
141
{
142
142
"cell_type" : " code" ,
143
- "execution_count" : 5 ,
143
+ "execution_count" : 26 ,
144
144
"metadata" : {},
145
145
"outputs" : [
146
146
{
147
147
"name" : " stdout" ,
148
148
"output_type" : " stream" ,
149
149
"text" : [
150
- " Problem solved in 398 milliseconds\n " ,
151
- " Optimal objective value = 31\n " ,
152
- " x : 15 \n " ,
153
- " y : 8 \n "
150
+ " Problem solved in 699958 milliseconds\n " ,
151
+ " Optimal objective value = 31\n "
154
152
]
153
+ },
154
+ {
155
+ "data" : {
156
+ "text/html" : [
157
+ " <table><thead><tr><th><i>index</i></th><th>Name</th><th>Value</th></tr></thead><tbody><tr><td>0</td><td>x</td><td>15</td></tr><tr><td>1</td><td>y</td><td>8</td></tr></tbody></table>"
158
+ ]
159
+ },
160
+ "metadata" : {},
161
+ "output_type" : " display_data"
155
162
}
156
163
],
157
164
"source" : [
You can’t perform that action at this time.
0 commit comments