Java algorithms to calculate/optimize solution