added generic Solve trait
implemented abstract simulated annealing
refactored code