|
-
Adjacency list representation of a graph
Hey everyone,
I'm starting to code a directed graph using an adjacency list and I'm running into a little trouble. I understand the concepts of the adjacency list structure, but I cant write seem to figure out how to code one. So far I'm using two doubly linked lists for storing the vertices and edges, and each is in its own class (I thought this would come in handy when later coding traversals in the graph). In the graph class, I'm thinking that an array list would work to store the adjacent vertices (each value in the array storing a list of vertices which are adjacent). However, if this is right then I'm not sure what to do with the edges, and how to make each edge know which vertices it is connecting.. In general, I'm looking for comments/advice on this type of graph implementation. Anything will help. Thanks a lot.
Similar Threads
-
By ill_comms in forum ASP.NET
Replies: 0
Last Post: 10-27-2005, 12:16 AM
-
By white94cam in forum C++
Replies: 2
Last Post: 03-30-2005, 11:02 PM
-
By Steven in forum Database
Replies: 1
Last Post: 06-21-2002, 09:16 AM
-
By Weezie Jefferson in forum Web
Replies: 2
Last Post: 11-09-2001, 08:44 PM
-
By Larry Rebich in forum vb.announcements
Replies: 1
Last Post: 06-28-2001, 01:22 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks