We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 057259e commit 18e863fCopy full SHA for 18e863f
genetic_algorithm/knapsack.py
@@ -317,9 +317,7 @@ def run_ga(
317
best_value, best_weight = result["best_value"], result["best_weight"]
318
319
print(f"Knapsack capacity: {result['capacity']}")
320
- print(
321
- f"Best solution: value = {best_value}, weight = {best_weight}"
322
- )
+ print(f"Best solution: value = {best_value}, weight = {best_weight}")
323
# # Uncomment to inspect chosen items:
324
# best_items = [
325
# items[idx] for idx, bit in enumerate(result["best_genome"]) if bit == 1
0 commit comments