Hi guys,
I need to implement a program for simulating the flooting algorithm. Can someone suggest from where to start.

I will use structs or classes?
How the flow of the program will be?

Can someone suggest from where to start.

I'd start by creating a random connected graph (the simulation framework). Then you have the structure required to add a flooding algorithm.

I will use structs or classes?

Probably a good idea for the nodes of the graph.

How the flow of the program will be?

Like a flood. :D

I'd start by creating a random connected graph (the simulation framework). Then you have the structure required to add a flooding algorithm.


Probably a good idea for the nodes of the graph.


Like a flood. :D

I have the graph... It is given to me... it is of 10 nodes....
I dont know how to start implementing it... I will create variables , etc in each struct?

I will create variables , etc in each struct?

May I ask why you're writing a routing algorithm?

May I ask why you're writing a routing algorithm?

I have a project for it...

I have a project for it...

Don't take this the wrong way, but your questions so far suggest that you lack the programming ability to complete this project. Have you worked with graphs before, in any format?

The flooding algorithm itself is pretty trivial, conceptually:

flood(node, packet)
begin
    assign(node, packet)

    foreach (link in node)
        if (not received(link, packet)) then
            flood(link, packet)
        endif
    loop
end

Most of the work is creating the simulation and metric gathering details.

Don't take this the wrong way, but your questions so far suggest that you lack the programming ability to complete this project. Have you worked with graphs before, in any format?

The flooding algorithm itself is pretty trivial, conceptually:

flood(node, packet)
begin
    assign(node, packet)

    foreach (link in node)
        if (not received(link, packet)) then
            flood(link, packet)
        endif
    loop
end

Most of the work is creating the simulation and metric gathering details.

Yes you are right, I lack the programming skills but I need to complete it. The hard or the easy way. I dont understand what do you mean by graphs. In programming you mean? I dont think so... So the algorithm you mention here it should work?

I find it baffling how your teacher would give you an assignment that essentially requires writing a graph when you haven't even learned about them. Check this out for some basic information.

I find it baffling how your teacher would give you an assignment that essentially requires writing a graph when you haven't even learned about them. Check this out for some basic information.

SO basically I need to write a network graph code in order to implement this?

This is a simulation, of course you need to simulate a network graph.

This is a simulation, of course you need to simulate a network graph.

got it now...
So i need to simulate the graph and then take your code and apply it there... right?

Thanks for the help...

Hi guys,
I need to implement a program for simulating the flooting algorithm. Can someone suggest from where to start.

I will use structs or classes?
How the flow of the program will be?

This is really hard....

some thoughts

struct node {

char name;
int maxcapacity;
int maxpackets;
int counter;


}node1; node2;node3

etc....
How I am going to associate the necx and previous node? linked lists????

How I am going to associate the necx and previous node? linked lists????

A linked data structure is one way to implement graphs. Check the Wikipedia article I gave you before, it describes common data structures for graphing algorithms.

Do you know how to program in c or c++??

Do you know how to program in c or c++??

I am not an advanced programmer , but the basics yes

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.