Skip to content

Commit 7cbf006

Browse files
Polish up
1 parent d81e802 commit 7cbf006

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

genetic_algorithm/knapsack.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
"""Did you know that Genetic Algorithms can be used to quickly approximate
22
combinatorial optimization problems such as knapsack?
33
4+
Genetic algorithms: https://en.wikipedia.org/wiki/Genetic_algorithm
5+
Evolutionary computation: https://en.wikipedia.org/wiki/Evolutionary_computation
6+
Knapsack problem: https://en.wikipedia.org/wiki/Knapsack_problem
7+
48
Run doctests:
5-
python -m doctest -v ga_knapsack.py
9+
python -m doctest -v knapsack.py
610
"""
711

812
import random
913
from dataclasses import dataclass
1014

11-
# Keep module-level RNG deterministic for examples that rely on random,
12-
# but individual doctests re-seed locally as needed.
1315
random.seed(42)
1416

1517
# =========================== Problem setup: Knapsack ===========================

0 commit comments

Comments
 (0)