algorithms for decision making python