Intelligent waterways for reducing congestion at locks