Static routing algorithm