How many {solves} are to/by {shortest path problem} ?
What is the number of methods for solving the shortest path problem?
How many ways can the shortest path problem be solved?
SELECT ( COUNT ( ?k ) AS ?n ) { ?k property:computes_solution_to resource:shortest_path_problem }
SELECT (COUNT(?sub) AS ?subs ) {
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?sub .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P2159> .
?statement <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> http://wikidata.dbpedia.org/resource/Q1058754 .
} 

SELECT (COUNT(?sub) AS ?value ) { ?sub wdt:P2159 wd:Q1058754 }
6