How to get all adjacent TopoDS_Edge by choosing the first and last TopoDS_Edge

Hello everybody!

I want to choose several TopoDS_Edge for merging them into a B-Spline curve, but the TopoDS_Edge is so much (maybe over 10).

So whether there's a function that can help users only choose the first and last TopoDS_Edge, then get all TopoDS_Edge between them?

Any Ideas? Welcome to discuss, Thanks.