| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| reel.mp4 | 2026-06-05 | 71.1 MB | |
| video.mp4 | 2026-06-05 | 65.0 MB | |
| video_thumb.png | 2026-06-05 | 2.1 MB | |
| reel_thumb.png | 2026-06-05 | 2.5 MB | |
| pygad-3.7.0-py3-none-any.whl | 2026-06-05 | 218.3 kB | |
| pygad-3.7.0.tar.gz | 2026-06-05 | 266.3 kB | |
| PyGAD-3.7.0 source code.tar.gz | 2026-06-05 | 3.0 MB | |
| PyGAD-3.7.0 source code.zip | 2026-06-05 | 3.2 MB | |
| README.md | 2026-06-05 | 12.0 kB | |
| Totals: 9 Items | 147.4 MB | 0 | |
- Validation logic is applied to validate the
num_generationsparameter. - The
num_generationsparameter must be assigned a positive integer. Previously, any number (positive/negative, int/float) was accepted. - A new script called
activation.pyis added into thepygad.helpermodule to include the activation function used by thecnnandnnmodules. - In the
pygad.parent_selection.ParentSelectionclass, thestochastic_universal_selection()method now calls thewheel_cumulative_probs()method instead of repeating the code of calculating the probabilities used for parent selection. - The
wheel_cumulative_probs()method in thepygad.parent_selection.ParentSelectionclass is refactored to reduce its computational time. - Use
numpy.where()to decide which the source parent of each gene within theuniform_crossover()method in theutils/crossover.pyscript. The same was already applied to thescattered_crossover()method. - Add tests for the following modules:
nncnngacnnkerasgatorchga- Fix a bug in the
visualize/plot.pyscript where thelabelsparameter ofboxplot()has been renamedtick_labelsin Matplotlib. - Fix a bug where the
best_solutions_fitnesslist (instance attribute topygad.GA) has the fitness of the last generation duplicated when an early stop happens inside theon_generation()callback. This made its size incompatible with thebest_solutionslist. - The documentation is refactored to solve many language issues and the Furo theme is applied. For easy navigation, the index is reformatted to only show the main sections. At each page, its index is shown at the right side. A new theme toggle button to change theme between light and dark.
- Support of multi-objective optimization using the Non-Dominated Sorting Genetic Algorithm III (NSGA-III). NSGA-III replaces the crowding distance of NSGA-II with niching against a structured grid of reference points, so it scales better to problems with 4 or more objectives. The new
NSGA3class lives in the newpygad/utils/nsga3.pyscript and is mixed into thepygad.GAclass the same wayNSGA2is. - Two new parent selection methods are added to support NSGA-III: 1)
nsga3_selection()for plain NSGA-III selection, and 2)tournament_selection_nsga3()for the tournament variant. Use them by settingparent_selection_typeto'nsga3'or'tournament_nsga3'. - A new parameter
nsga3_num_divisionsis added to thepygad.GAconstructor. It is required whenparent_selection_typeis'nsga3'or'tournament_nsga3'and sets the number of divisions per objective axis used to build the structured reference points (thepparameter from Deb & Jain 2014). The total number of reference points isC(M + p - 1, p)whereMis the number of objectives. - When
sol_per_popis smaller than the number of NSGA-III reference points, PyGAD raises a warning and grows the population to match before the generational loop starts. - A new crossover operator: Simulated Binary Crossover (SBX). Use it by setting
crossover_type='sbx'. The shape of the spread is controlled by the newsbx_crossover_etaparameter (default 30). - A new mutation operator: polynomial mutation. Use it by setting
mutation_type='polynomial'. The size of the change is controlled by the newpolynomial_mutation_etaparameter (default 20). - Two new stop criteria:
time_<seconds>stops the run when the time insiderun()is at least the given number of seconds;evaluations_<N>stops the run when the number of fitness function calls reaches the given count. New instance attributenum_fitness_evaluationscounts the calls. - A new submodule
pygad.utils.quality_indicatorswith four functions to measure the quality of a Pareto front:hypervolume,inverted_generational_distance,generational_distance, andspacing. - A new submodule
pygad.benchmarkswith built-in benchmark problems.pygad.benchmarks.classichas Sphere, Rastrigin, Rosenbrock, Griewank, Schwefel, Ackley, and Himmelblau.pygad.benchmarks.zdthas the ZDT family (ZDT1, ZDT2, ZDT3, ZDT4, ZDT6).pygad.benchmarks.dtlzhas DTLZ1, DTLZ2, DTLZ3, and DTLZ4.pygad.benchmarks.knapsackhas the 0/1 Knapsack problem. Each class is callable with the PyGAD fitness signature and returns negated values (for the minimization-style problems) so PyGAD can maximize toward the original minimum. - Update the documentation to reflect the recent additions and changes to the library structure.
- A new benchmark
pygad.benchmarks.tspwith aTSPclass for the Travelling Salesman Problem. The class accepts either 2Dcoordinatesor a precomputeddistance_matrix, exposesgene_space,gene_type, andallow_duplicate_genesfor the permutation encoding, and returns the negative tour length as the fitness. - Two new example folders under
/examples:examples/benchmarks/has one runnable example per benchmark (classic, ZDT, DTLZ, knapsack, and TSP), andexamples/quality_indicators/has one runnable example per quality indicator (hypervolume, IGD, GD, and spacing). plot_pareto_front_curve()now also supports 3 objectives (3D scatter). M >= 4 still raises and points to the new high-dimensional plots.- Seven new plot methods on
pygad.GA. The first three work on the final population (no extra flag needed):plot_pareto_front_pcp()(parallel coordinates, any M >= 2),plot_pareto_front_scatter_matrix()(M-by-M pairwise scatter, best for M >= 4), andplot_pareto_front_heatmap()(solutions-by-objectives heatmap). The other four requiresave_solutions=True:plot_fitness_band()(per-generation min / mean / max with a shaded band),plot_non_dominated_hypervolume()(hypervolume of the non-dominated set per generation),plot_population_diversity()(mean pairwise distance per generation), andplot_pareto_front_evolution()(non-dominated set overlaid every k generations). - Fix a latent divide-by-zero in
NSGA3.nsga3_normalize_fitness(). The safeguard for near-zero denominators used to collapse to0for tiny negative values (the realistic case under PyGAD-max), which silently produced wrong normalized values. The safeguard now keeps the negative sign. - Refactor the NSGA classes to keep each script focused. A new module
pygad/utils/nsga.pyhosts theNSGAmixin withnon_dominated_sorting()andget_non_dominated_set(), which are shared between NSGA-II and NSGA-III.nsga2.pynow only carries NSGA-II specific code (crowding_distance,sort_solutions_nsga2).nsga3.pynow only carries the NSGA-III algorithm primitives. Thensga3_selection()andtournament_selection_nsga3()methods have moved topygad/utils/parent_selection.pynext to their NSGA-II counterparts. The engine-time helpers_bootstrap_nsga3_reference_points(),_nsga3_grow_population(),_nsga3_generate_extra_random_solutions(), and_nsga3_generate_single_random_gene()now live inpygad/utils/engine.py. - Rename NSGA-III novel names to start with
nsga3_so the algorithm-specific surface is easy to spot. Algorithm primitives becomensga3_generate_reference_points,nsga3_compute_ideal_point,nsga3_find_extreme_points,nsga3_compute_intercepts,nsga3_normalize_fitness,nsga3_associate_to_reference_points, andnsga3_niching_select. Module-level helpers gain the same prefix (_nsga3_pick_target_reference_point,_nsga3_pick_candidate_at_reference,_nsga3_enumerate_compositions,_nsga3_validate_multi_objective_fitness,_nsga3_accumulate_fronts). The constants are renamedNSGA3_ASF_EPSILONandNSGA3_INTERCEPT_NEAR_ZERO. Names that already had NSGA-II parallels (tournament_selection_nsga3,pareto_fronts,non_dominated_sorting) keep their original spelling. - Spell every name and docstring in American English (
normalize,maximize,behavior,color,optimization, ...) so the library stays consistent. - Expand abbreviated names introduced by the NSGA-III refactor:
fl_indicestocritical_front_indices,fl_assoctocritical_front_associations,fl_disttocritical_front_distances,st_indicestoselection_pool_indices,st_fitnesstoselection_pool_fitness,accepted_assoctoaccepted_associations,Ktonum_to_select(innsga3_niching_select). - The NSGA-III population auto-growth path now respects every initial-population rule:
init_range_low/init_range_high,gene_space,gene_type(single dtype or nested per-gene[type, precision]),gene_constraint, andallow_duplicate_genes=False. Previously, only the gene-space / init-range sampling step was applied; gene constraints and duplicate resolution were skipped, which could leave the grown rows in an invalid state. - A new
Reportmixin inpygad/utils/report.pyaddsga_instance.generate_report(filename, ...)to build a PDF report of the run. The report bundles a configuration table, a run-summary table, the best solution, and every applicable plot (auto-selected based on the run's properties: SOO vs MOO, number of objectives,save_solutions,save_best_solutions). The report usesreportlabandmatplotlib, both available through the new optional dependency extrapip install pygad[report]. - A new example
examples/example_generate_report.pyshows how to build a PDF report after running a multi-objective GA. - The
pygad.md,releases.md,visualize.md, andutils.mddocumentation pages were updated to reflect the new module layout, the renamed methods, the newgenerate_report()entry point, and the new NSGA-III instance attributes (nsga3_num_divisions,nsga3_reference_points). The "Other Instance Attributes & Methods" section inpygad.mdis now grouped by area (Lifecycle, Population, Fitness, Parent Selection, NSGA-II, NSGA-III, Crossover, Mutation, Elitism, Gene Constraints, Saving) so each method or attribute appears under its topic. - Fix issue https://github.com/ahmedfgad/GeneticAlgorithmPython/issues/351 by updating the documentation to clarify what the
solutionhas. - Version changed in the following modules:
1. A new submodule
pygad.benchmarksis added with the version1.0.0. 2. The version of thepygad.utilssubmodule is upgraded from1.4.0to1.5.0. 3. The version of thepygad.helpersubmodule is upgraded from1.3.0to1.4.0. 4. The version of thepygad.visualizesubmodule is upgraded from1.1.1to1.2.0. 5. The version of thepygad.nnsubmodule is upgraded from1.2.2to1.2.3. 6. The version of thepygad.cnnsubmodule is upgraded from1.1.1to1.1.2. 7. The version of thepygad.kerasgasubmodule is upgraded from1.3.1to1.3.2. 8. The version of thepygad.torchgasubmodule is upgraded from1.4.1to1.4.2. 9. The version of thepygad.gannsubmodule is upgraded from1.0.0to1.0.1. 10. The version of thepygad.gacnnsubmodule is upgraded from1.0.0to1.0.1. - The PDF report built by
generate_report()now shows the PyGAD logo on its title page. The logo image ships with the package, so no network access is needed. If the image file is missing, the report is built without it. - Two private helper functions are added to the
pygad/utils/report.pyscript for the logo._pdf_report_read_logo_bytes()reads the bundled logo file and returns its bytes, orNoneif the file is missing._pdf_report_build_logo_image()builds the image that is placed on the title page, or returnsNoneso the report still builds without the logo. - The private helper functions in the
pygad/utils/report.pyscript are renamed to start with the_pdf_report_prefix so their purpose is clear from the name. For example,_build_title_section()becomes_pdf_report_build_title_section()and_render_plot_to_png()becomes_pdf_report_render_plot_to_png().