below here is the question

anyone who wish to help may contact me [email protected]

either email or YM! awanz89

i do have a part of the source code that i know in doing the read text.file or write a text file

attached is the assignment question asking_help_from_the_net.doc

**(43.5K)**

Number of downloads: 82

below here also my code... just a part of it... I am still in blurred on how to do it.. Please help me...

#include<stdio.h> struct TNode{ double x,y; }; TNode *Nodes; int NumNodes; int main(int argc,char *argv[]) int k; { FILE *fp; fp=fopen("Node.data"."r"); if(fp==NULL) {return -1;} fscanf(fp,"%d",.&NumNodes); Nodes=new TNode(NumNodes); k=0; while(!feof(fp)) { fscanf(fp,"%f%f",&Nodes[k].x, &Nodes[k].y); k++; } fclose(fp);

In mathematics and computer science a graph is a set of objects called points, nodes, or vertices connected by links called lines or edges. A link between two nodes indicates that the nodes are neighbours of each other. This program will determine whether a randomly generated graph is fully connected.

Input: Maximum dimensions of an area (Xmax, Ymax), Number of nodes N, and distance D.

Program function:

1. Each node has a unique numeric identifier, which should be in the range from 0 to N-1.

2. Distribute the nodes in the given area randomly, such that each node has a position (x, y).

3. Each node is considered a neighbour to another node if the distance between them is less than D.

4. Determine if the graph is considered fully connected. A graph is considered fully connected if there exists a path between every pair of nodes in the graph.

Output:

1. Print the coordinates for each of the nodes to a text file. The text file must be in the following format:

<Node ID> <X> <Y>. For example,

0 3.22 4.22

1 1.45 2.34

2 2.42 4.23

2. Print a statement to indicate whether the graph is fully connected.

Hints:

1. Use array for graph implementation

2. Google keywords: breadth-first search and depth-first search.

Examples:

(a) In the follow graph, the distance of node 4 to any other nodes is larger than the given distance, D. Thus, it has no neighbour. Since node 4 is isolated from other nodes, the graph is NOT fully connected.

( In the following example, the distance between node 0 and node 4 is smaller than D. Thus node 0 and node 4 are neighbours. The resultant graph is FULLY connected.

© In the following example, the graph is partitioned into two clusters. Thus, it is also NOT fully connected.

** Edit **