This part of the code sample explains how to get the already optimized route of the sequence.
You can generate a valid unique route ID in the step Sequence Optimization - Create and Optimize a Sequence.
To delete an already existing route, use the code sample Sequence Optimization - Delete the Sequence.