dhevenstone - 2014-07-02

Hi Everyone,

I have a program where I was running a simulation where I created one network with two types of edges - first friendship edges, and then, once friendship edges were generated, I ran a matching algorithm (Gale Shapely) with information limited to one's local network, and saved those new edges onto the original graph, just labeling them differently.

I would like split this into 2 graphs: a friendship graph and a relationship-history graph. I understand I can create a separate graph and just put copies of the nodes in the new graph.

My first graph was created in SimpleGraphView.java and in the constructor I added all the vertices.

My question is whether I can create the second graph (just the vertices, before edges are created) in the same file, directly after the first graph. It seems like it might be problematic in terms of visualization. On the other hand, if I can't create the second graph there, I'm not sure where I would create it.

A shortened version of the original code is something like this:

public class SimpleGraphView {
static Graph<Integer, String=""> g;
for (Women aWoman : GaleShapely2.womenList) {
g.addVertex(aWoman.getID());
}
}

I imagine the new code would be something like this:

public class SimpleGraphView {
static Graph<Integer, String=""> g;
static Graph<Integer, String=""> g2;
for (Women aWoman : GaleShapely2.womenList) {
g.addVertex(aWoman.getID());
}
g2.addVertex(g.getVertices());
}

Would that work?