I often see one spurious "seeking recommendation" vote on questions in tags I follow ([assembly], [sse], etc.), often on questions that could (and should) have been answered by reading the documentation, typically the manual entry for a specific asm instruction.
Such questions don't explicitly or even implicitly ask for a link to documentation, but I think some people's thought process is something like "this person should have checked the documentation instead of posting this question, and a link to docs could be an answer", therefore "wanting an answer to this is wanting documentation", and "that's the same thing as wanting a link do documentation*. Thus they VTC with the "seeking recommendation" close reason.
(This is incorrect reasoning, multiple of those steps are obviously faulty, and that close reason doesn't apply in such cases. Those questions are usually just bad and if so should be downvoted, and often can be closed as duplicates, but other close reasons usually don't apply either.)
Note: I'm not saying your question was bad. I'm just sharing my experience seeing this close reason pop up when it doesn't apply on questions people happened not to like. Those other questions I'm referring to often are simple failure to check the documentation for the specific instruction that isn't doing what they want / expect. (In many cases I did agree with the downvote, and sometimes also close for too broad or unclear / needs details, but in other cases there was an interesting corner case that needed careful reading of the documentation and was worth addressing in an answer.)
It's possible someone could have applied the same faulty reasoning here, if they happen to know that jgrapht documentation describes how to do what you want with some function.
It's ok for the / an answer to be "there's a library with a function that does what you're looking for", as long as the question is a specific problem that could also be answered with a self-contained answer.
There's a grey area where what you're looking for is too big to expect someone to write for you as an answer, so only a "here's a library function" answer could really work. That would be implicitly asking for a library. I don't think that applies here, especially since you're asking how to do it with a specific library already in mind. That's very different: the ultimate goal of that close reason is to avoid answering being competing recommendations for different libraries, because including a whole library for each minor problem you run into while writing a program doesn't scale well in many languages.