this phrase means that you cannot modify the graph specified when creating the CycleDetector and expect the CycleDetector to work correctly. Instead, you should create a new CycleDetector after every modification to the graph, and use this new CycleDetector.
Since this is what you say you do, I guess there is a bug in your code, or a bug in CycleDetector or a mistake is made when manually checking for cycles. Try to find a minimal example of the problem.
Information System on Graph Classes and their Inclusions (ISGCI) http://www.graphclasses.org
----- Reply message -----
From: "Rui Chang" <chang.rui@...>
Subject: [jgrapht-users] A question to cycle detection using DefaultDirectedGraph
Date: Sun, Sep 30, 2012 19:07
Hi All, I am new to JGraphT. I want to use CycleDetector to detect cycles in a DefaultDirectedGraph. In my code, the graph is initialized/constructed at the beginning of the program, then I have a loop, in each of which, the graph is modified by calling addEdge and/or removeEdge randomly. But the total vertex set stay the same. In each loop, after modification on graph, I initiate a new CycleDetector class to detect cycles in the modified graph, but sometimes, I see obviously there are cycles in the modified graph, which is not captured by CycleDetector!
I wonder is it some bug or is it my mistake to use CycleDetector in this way as I recall the javadoc of CycleDetector class says something like: "The inspected graph is specified at construction time and cannot be modified"...
But I don't know if I really understand what it means...
Thanks for any thought!Best,Ray