Changes on getEdgeSource(vertex) are not reflected on the graph

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Changes on getEdgeSource(vertex) are not reflected on the graph

Tobias Strickfaden
Dear *,

I am having an unexplainable problem with the getEdgeSource(vertex) method, somehow the changes I make on the received nodes are not reflected on the graph, for getEdgeTarget(vertex) on the other hand, this works without problems. Do you have any idea why this happens?

        mGraph = (DirectedGraph<Node, DefaultEdge>) ((AbstractBaseGraph)graph).clone();
 
        // iterate over every node (i have also tested this with various iterators)
        for (Node node : mGraph.vertexSet()) {

                // iterate over ingoing edges. this loop should only run once since we check indegree == 1
                for (DefaultEdge edge : mGraph.incomingEdgesOf(node)) {
                    Node source = graph.getEdgeSource(edge);
                    source.size++; // this size is not increased later
                }
        }


I also tried using the EdgeReversedGraph, but there the problem exists too (for reversed getEdgeTarget/Source). Moreover I also tried changing the nodes after I iterated over the graph

Best Regards
Tobias

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
jgrapht-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgrapht-users
Loading...