Algorithms for geometric control of systems over rings