473,408 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Digraph Class

I was thinking of implemented a class that would let you build a an
arbitrary class and was wondering if this as already been done before(I
assume it has, but just wondering).

The basic idea that I'm thinking of is to include a list of pointers to
classes that are the in's and the classes that are outs with a class type
for each edge(which can represent the "edges" value).

Basicaly, call it a node, the node contains a list of pointers to edges. An
edge is a class that points to a the edges "value"(a class type) and the end
of the edge with a direction flag.

After all that then I was thinking to develop some algorithms to
combine/remove nodes and do some computation(find shortest path, etc...).
Ofcourse, I have to worry about cycles and possibly long computational time,
but no big deal at the moment.

Anyways, anyone have any ideas for this? Maybe how I can do this more
efficently and also the most general? my idea right now is basicaly have two
classes node and edge with the node class containing a pointer to a list of
pointers of edges. I'm not sure what I will need to make being able to
compute things the most general though. Like say I have a digraph where each
node represents a part of a string... I need some general algorithms that
will work find if they were numbers(such as probabilities), but not sure if
the node is something more general. What I'm thinking is basically one
would extend the node class to override some computational functions so it
will still work, but I'm then I think that I'm still limiting the
possibilities.

What I want to do is make is the most general it can be, as I've said... so
you could have different "types" of nodes and different "types" of edges.
Like some nodes could be people and others are numbers. Its up to the person
who implements the class to specify how nodes interact through the edges. I
guess what I'm thinking of doing is having the user override the arithmetic
operators and using those to implement things such as shortest path, etc...
(gotta read over some graph there first I suppose).
any ideas?
Jon
Jul 23 '05 #1
2 1984
"Jon Slaughter" <Jo***********@Hotmail.com> wrote...
I was thinking of implemented a class [...]
any ideas?


Have you seen GTL (Graph Template Library)? Or Boost Graph Library?
Jul 23 '05 #2

"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:V5********************@comcast.com...
"Jon Slaughter" <Jo***********@Hotmail.com> wrote...
I was thinking of implemented a class [...]
any ideas?


Have you seen GTL (Graph Template Library)? Or Boost Graph Library?

I haven't, I will search for them.

Thanks.
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Murat Tasan | last post by:
hi, i am having a small problem with constructing an inner class. i am using an inner class (and not a static nested class) because the methods of the inner class need access to the enclosing...
2
by: Fernando Rodriguez | last post by:
Hi, I need to traverse the methods defined in a class and its superclasses. This is the code I'm using: # An instance of class B should be able to check all the methods defined in B #and A,...
2
by: Gabriel Genellina | last post by:
Hi In the following code sample, I have: - a Worker class, which could have a lot of methods and attributes. In particular, it has a 'bar' attribute. This class can be modified as needed. - a...
1
by: Oplec | last post by:
Hi, I'm learning C++ as a hobby using The C++ Programming Language : Special Edition by Bjarne Stroustrup. I'm working on chpater 13 exercises that deal with templates. Exercise 13.9 asks for me...
9
by: Banaticus Bart | last post by:
I wrote an abstract base class from which I've derived a few other classes. I'd like to create a base class array where each element is an instance of a derived object. I can create a base class...
5
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits...
1
by: MakaMaka | last post by:
Hi, Does anybody know of a good widget for wxpython, gtk, etc. that allows the editing of block diagrams and make it easy to export the diagram as a digraph? It has to be available under Windows....
3
by: Hamilton Woods | last post by:
Diehards, I developed a template matrix class back around 1992 using Borland C++ 4.5 (ancestor of C++ Builder) and haven't touched it until a few days ago. I pulled it from the freezer and...
0
by: emin.shopper | last post by:
I had a need recently to check if my subclasses properly implemented the desired interface and wished that I could use something like an abstract base class in python. After reading up on metaclass...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.