SageMath implementations

algo4

algo5

Here you can start to explore these algorithms: SageMathCloud.