What limits are you using?
(also are you always going to be starting from a certain starting node? If so you may want to change your cypher approach accordingly)
The point of my previous request was for you to check if the number of possible paths being returned is reasonable, or if it's far too much than you'd want to work with at once. That is, if this is returning millions or billions of results, is that something you really need? Is there any amount of paths where you would want it to cut off, or will you always be working with the result set, no matter how high that could go?
You can use a LIMIT before your count() aggregation to do something similar to the
limit within the expandConfig() call. Also, have you verified that the paths you're getting are all useful, and what you're looking for, or are there additional filtering you would need to get your desired result set?