Need to determine how the GAS SERVICE is used, and what could replace it with minimal impact.
There are examples of BFS (breadth first search) usage at https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/query_optimization#GAS_Service. And, a single example of SSSP (shortest path) usage at https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples.
Much more information from the community is needed.