473,509 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

network

I have a little problem,
that i'd like to read your comments and suggestions
I create a network of 5-10 nodes - a weighted digraph
which all nodes are connected randomly at runtime.
Loops are allowed in the graph.
Is it possible to *hash* pairs of nodes
as well as their costs by use of the following snip,
template<typename T>
struct HashNodes{
T startNode;
T endNode;
int weight[];
};

This is clumpsy and possibly won't work
but I am clueless as of where should I go

May 9 '07 #1
2 1128
On 9 Maj, 10:24, Complex Humans <codar4mys...@yahoo.comwrote:
I have a little problem,
that i'd like to read your comments and suggestions
I create a network of 5-10 nodes - a weighted digraph
which all nodes are connected randomly at runtime.
Loops are allowed in the graph.
Is it possible to *hash* pairs of nodes
as well as their costs by use of the following snip,

template<typename T>
struct HashNodes{
T startNode;
T endNode;
int weight[];

};

This is clumpsy and possibly won't work
but I am clueless as of where should I go
Do I understand you correctly that you want a way to quickly get the
weight given two nodes? In that case I would use
std::map<std::pair<Node, Node>, doubleand create a functor which
given two std::paid<Node, Nodeorders them in some way (on other way
implements a less than function for pairs of std::paid<Node, Node>.
Exactly how this is done is not particularly important, and if you
have some ID for each node there should be no problem.

--
Erik Wikström

May 9 '07 #2
On 2007-05-09 15:26, Erik Wikström wrote:
On 9 Maj, 10:24, Complex Humans <codar4mys...@yahoo.comwrote:
>I have a little problem,
that i'd like to read your comments and suggestions
I create a network of 5-10 nodes - a weighted digraph
which all nodes are connected randomly at runtime.
Loops are allowed in the graph.
Is it possible to *hash* pairs of nodes
as well as their costs by use of the following snip,

template<typename T>
struct HashNodes{
T startNode;
T endNode;
int weight[];

};

This is clumpsy and possibly won't work
but I am clueless as of where should I go

Do I understand you correctly that you want a way to quickly get the
weight given two nodes? In that case I would use
std::map<std::pair<Node, Node>, doubleand create a functor which
given two std::paid<Node, Nodeorders them in some way (on other way
implements a less than function for pairs of std::paid<Node, Node>.
Hmm, not even I can parse the last bit of that. What I meant was to say
that you should implement a 'less than' function so that you can compare
two std::pair<Node, Nodeobjects and tell which of them is the
smallest, for some definition of smallest.

--
Erik Wikström
May 9 '07 #3

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

Similar topics

8
50526
by: Alex Ang | last post by:
I have written the following VBScript program. It is stored into a file "map_drive.vbs". It successfully mapped to a network drive \\server1\data. Dim WshNetwork Set WshNetwork =...
14
9718
by: David W. Fenton | last post by:
I'm no stranger to this error message, but I have a client who is experiencing it, but, fortunately, without any actual data corruption, and it's driving them made. Their inability to grasp that...
1
6552
by: brian.oneil2 | last post by:
Is there a way to install this onto a network file share and allow a team to access it? I would say share a CD from a networked CD drive, but there are multiple CD's that would have to be inserted....
1
2925
by: Naveen Mukkelli | last post by:
Hi, I've got 3 Network Interface Cards(NIC) in my PC. Lets say NIC1, NIC2, NIC3. I have openend network connections in control panel and renamed them to Network 1, Network 2, Network 3. I'm...
5
3089
by: Dave Kolb | last post by:
Is there any other solution for an ASPNET application to access network resources other than running as SYSTEM, using delegation (a nightmare to get to work) or the COM+ solution? I cannot seem to...
4
2467
by: Dixie | last post by:
I want to send a file to each persons home network space. I believe that when a person logs onto a network, some sort of variable is set that identifies the user. Is there any code that would...
8
3006
by: BJ | last post by:
Problem: How can I code up a client side process to detect if the network is available? Synopsis: I am writing ASP.NET input forms for a Panasonic Tuff book. The users will be walking around...
2
1935
by: Salad | last post by:
If I work on my app on my standalone, things are always fast. If I have an non-split app on the network it runs fast. If I split the app and have both the front end and backend on the network...
10
6135
by: gary0gilbert | last post by:
An unusual spin to this recurring disk or network error in a Terminal Server environment. Access 2000, Terminal Server 2000, file server is windows 2000. All users have a separate copy of the...
0
3757
by: nancylife | last post by:
When developing web report, many developers use VMware to simulate different operating systems on a same server. Then, they can realize cross-platform deployment and debug of web report. According to...
0
7233
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
7135
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
7410
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7067
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7505
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...
1
5060
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
4729
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...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
440
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.