I am having trouble accessing an edgelist of a vertex(which is another object of vertex linked to it). Any ideas how?

like for example i have
Edge.cs, Vertex.cs, DirecGraph.cs

In the DirectGraph.cs

IDictionary < String, Vertex> dic = new IDictionary< String, Vertex>();
// Then add a vertex type object in the dictionary
Vertex newV;
dic.Add(newV.getVertex(), Vertex);// this works

//now to add another vertex to the dictionary i just need to call the above code

now if i create 2 vertices, a and b, i can set the b as an edgelist of a. (I can see this in the memory while in a debug mode and it works). But trying to print/access Vertex b as an edgelist of Vertex a is a pain. Any ideas how?

Recommended Answers

All 2 Replies

Not without seeing all the code. We can't tell how you implemented your graph structure as we can't see your screen from here.

Not sure if you typo'd your above code but you're adding a type to the dictionary not an object. Unless you made it some kind of static I'm not even sure how that would compile.

Also we do need to see how you're recording the fact that it's an edge list and also how you're trying to recall it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.