![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
PFO Founder
![]() ![]() |
Ok i have a question to ask. i have created a templated graph class and now i need to use the graph class in a map type program were the vertex's are cities and the wieghted edges are the roads with miles on them. and i am suppose to have the vertices as a class i created. kind of like say i call my graph class would be like this Graph<City> map(WEIGHTED); or something like that. i was wondering what kind of stuff am i goin to have to put in the City class. will it have to be a big class or will it only need a few small things. im just looking for an idea on what to do here. thanks
![]()
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#2 |
|
Expert Programmer
|
Well first you are going to have to create CITY and export all variables and functions exactly as Graph is going to need them... I assume that Graph is a templated you created as well?
City will need a big matrix which will store the nodes (for both columns and rows) and the value that intersects will be the corresponding weighted link value representing a road. (There are other ways to represent a graph as well that are a bit more efficient than this, as in they consume less memory, you can look into using them yourself if you really wanted to). Anyway, I think this is what you want... I am not entirely sure the relation between the Graph template and the City class, perhaps you could explain more what purpose each of these objects serve.
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#3 | ||
|
PFO Founder
![]() ![]() |
The templated graph class is a fully working graph class but now i am suppose to do this
Quote:
Quote:
if you want to see the code for the templated graph i will be posting it later
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
||
|
|
|
|
|
#4 |
|
PFO Founder
![]() ![]() |
does anyone understand what im trying to ask even. im curious if im asking the right question. well here goes another shot i guess. I have created a class called Graph. and it is templated so you would normally call it something like this
Graph<int> graph(WEIGHTED); Graph<City> graph(WEIGHTED);
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|