[mapguide-users] Topology.net and mapguide
Jamo
adam.jamison at portbris.com.au
Thu Jan 14 18:39:53 EST 2010
Anyone able to help me with these C# interface things? I've never really had
to use one yet or if I have i've done it by accident....?
I think an Interface is like a conversion from one type to another, is this
correct?
This code works: which is great I can get all adjacent vertecies....
public void main()
{
AdjacencyGraph<int, TaggedEdge<int, string>> g = new
AdjacencyGraph<int, TaggedEdge<int, string>>();
g.AddVerticesAndEdge(new TaggedEdge<int, string>(1, 2, "To Train
Station"));
g.AddVerticesAndEdge(new TaggedEdge<int, string>(2, 3, "To
Subway"));
g.AddVerticesAndEdge(new TaggedEdge<int, string>(3, 4, "To Work"));
g.AddVerticesAndEdge(new TaggedEdge<int, string>(2, 4, "To Lunch"));
foreach (var vert in g.OutEdges(2))
Response.Write(vert.Tag + "<br />");
}
However I would now like to try the DijkstraShortestPathAlgorithm ...
AdjacencyGraph<int, TaggedEdge<int, string>> g = new AdjacencyGraph<int,
TaggedEdge<int, string>>();
g.AddVerticesAndEdge(new TaggedEdge<int, string>(1, 2, "To Train
Station"));
g.AddVerticesAndEdge(new TaggedEdge<int, string>(2, 3, "To
Subway"));
g.AddVerticesAndEdge(new TaggedEdge<int, string>(3, 4, "To Work"));
g.AddVerticesAndEdge(new TaggedEdge<int, string>(2, 4, "To Lunch"));
IVertexAndEdgeListGraph<int,TaggedEdge<int, string>> test = g;
IDictionary<TaggedEdge<int, string>,double> a = new
Dictionary<TaggedEdge<int,string>,double>();
//a.Values.Add(1);
a.Keys.Add(new TaggedEdge<int,string>(1,4,"route"));
DijkstraShortestPathAlgorithm<int, TaggedEdge<int, string>> Dij =
new DijkstraShortestPathAlgorithm<int, TaggedEdge<int, string>>(test, a);
I've got no idea what I'm meant to feed the class in order to start
performing shortest route calcs ?
How would I get an IVertexListGraph ? and is the adjacency graph actually a
graph object?
Has anyone used this, I've seen topology.net referred to a few times in
these forums?
--
View this message in context: http://n2.nabble.com/Topology-net-and-mapguide-tp4289752p4396134.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
More information about the mapguide-users
mailing list