mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
[mypy] Type annotations for searches directory (#5799)
* Update ternary_search.py * Update mypy.ini * Update simulated_annealing.py * Update ternary_search.py * formatting * formatting * Update matrix_operation.py * Update matrix_operation.py * Update matrix_operation.py
This commit is contained in:

committed by
GitHub

parent
c3d1ff0ebd
commit
745f9e2bc3
@ -1,6 +1,7 @@
|
||||
# https://en.wikipedia.org/wiki/Simulated_annealing
|
||||
import math
|
||||
import random
|
||||
from typing import Any
|
||||
|
||||
from .hill_climbing import SearchProblem
|
||||
|
||||
@ -16,7 +17,7 @@ def simulated_annealing(
|
||||
start_temperate: float = 100,
|
||||
rate_of_decrease: float = 0.01,
|
||||
threshold_temp: float = 1,
|
||||
) -> SearchProblem:
|
||||
) -> Any:
|
||||
"""
|
||||
Implementation of the simulated annealing algorithm. We start with a given state,
|
||||
find all its neighbors. Pick a random neighbor, if that neighbor improves the
|
||||
|
Reference in New Issue
Block a user