algorithmCompute method
Recursively call the compute method of the algorithm, and then call the compute method of the next algorithm 递归调用算法的compute方法,然后调用下一个算法的compute方法
Implementation
void algorithmCompute(GraphAlgorithm? algorithm) {
if (algorithm == null) return;
algorithm.compute(vertex, graph);
}