# An Innovative Approach For Computation Of Data Computer Science Essay

Published:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

Nowadays we use Dijkstra's algorithm to find the shortest path in which we use the pre-defined factor weight to find the shortest path. We can find only the shortest path alone. To overcome this we use two techniques called Random discretization and path delay discretization. Here we find the entire possible path using the logic given bellow. Using current node detail and the destination node is send by the source node to the neighborhood nodes. Neighborhood node receives the detail and checks for the destination node. In case the neighborhood node is not the destination means it appends its detail along with the received details and sends to its neighborhood nodes the process continues. Till all possible path is calculated. By calculating the time delay between the two nodes (link delay) we can find the time taken by a source to reach the destination. Finally we display the entire possible path along with the time. using Random discretization and path delay discretization we can find the shortest path based on time which is useful when congestion occurs in the network. when congestion occurs in the shortest path source takes more time to reach the destination .Even it take more time than the time taken by the shortest path. In our project we overcome this problem.

A major obstacle against implementing distributed multimedia applications (e.g., web broadcasting, video teleconferencing, and remote diagnosis) is the difficulty of ensuring quality of service (QoS) over the Internet. A fundamental problem that underlies many important network function such as QoS routing, MPLS path selection, and traffic engineering, is to find the constrained shortest path-the cheapest path that satisfies a set of constraints. It is the cheapest path whose end-to-end delay is bounded by the delay requirement of a time-sensitive data flow. The additional bandwidth requirement, if there is one, can be easily handled by a pre-processing step that prunes the links without the required bandwidth from the graph. The algorithms for computing the constrained shortest paths can be used in many different circumstances, for instance, laying out virtual circuits in ATM networks, establishing wavelength-switching paths in fiber-optics networks, constructing label-switching paths in MPLS based on the QoS requirements in the service contracts, or applying together with RSVP.

There are two schemes of implementing the QoS routing algorithms on routers The first scheme is to implement them as on-line algorithms that process the routing requests as they arrive. In practice, on-line algorithms are not always desired. When the request arrival rate is high (major gateways may receivethousands or tens of thousands of requests every second), even the time complexity of Dijkstra's algorithm will overwhelm the router if it is executed on a per-request basis.1 To solve this problem, the second scheme is to extend a link-state protocol (e.g., OSPF) and periodically pre-compute the cheapest delay-constrained paths for all destinations, for instance, for voice traffic with an end-to-end delay requirement of 100 ms. The computed paths are cached for the duration before the next computation. This approach provides support for both constrained unicast and constrained multicast. The computation load on a router is independent of the request arrival rate. Moreover, many algorithms, including those we will propose shortly, have the same time complexity for computing constrained shortest paths to all destinations or to a single destination. This paper studies the second scheme. A path that satisfies the delay requirement is called a feasible path. Finding the cheapest (least-cost) feasible path is NP-complete. There has been considerable work in designing heuristic solutions for this problem. Xue and Juttner used the Lagrange relaxation method to approximate the delay-constrained least-cost routing problem.

However, there is no theoretical bound on how large the cost of the found path can be. Korkmaz and Krunz used a nonlinear target function to approximate the multi-constrained least-cost path problem. It was proved that the path that minimizes the target function satisfies one constraint and the other constraints multiplied by , where is a predefined constant and is the number of constraints. However, no known algorithm can find such a path in polynomial time. Ref. proposed a heuristic algorithm, which has the same time complexity as Dijkstra's algorithm. It does not provide a theoretical bound on the property of the returned path, nor provide conditional guarantee in finding a feasible path when one exists. In addition, because the construction of the algorithm ties to a particular destination, it is not suitable for computing constrained paths from one source to all destinations. For this task, it is slower than the algorithms proposed in this paper by two orders of magnitude based on our simulations.

## Literature Survey:

## Approximation algorithms

In computer science and operations research, approximation algorithms are algorithms used to find approximate solutions to optimization problems. Approximation algorithms are often associated with NP-hard problems; since it is unlikely that there can ever be efficient polynomial time exact algorithms solving NP-hard problems, one settles for polynomial time sub-optimal solutions. Unlike heuristics, which usually only find reasonably good solutions reasonably fast, one wants provable solution quality and provable run time bounds. Ideally, the approximation is optimal up to a small constant factor (for instance within 5% of the optimal solution). Approximation algorithms are increasingly being used for problems where exact polynomial-time algorithms are known but are too expensive due to the input size.

A typical example for an approximation algorithm is the one for vertex cover in graphs: find an uncovered edge and add both endpoints to the vertex cover, until none remain. It is clear that the resulting cover is at most twice as large as the optimal one. This is a constant factor approximation algorithm with a factor of 2. NP-hard problems vary greatly in their approximability; some, such as the bin packing problem, can be approximated within any factor greater than 1 (such a family of approximation algorithms is often called a polynomial time approximation scheme or PTAS). Others are impossible to approximate within any constant, or even polynomial factor unless P = NP, such as the maximum clique problem.

NP-hard problems can often be expressed as integer programs (IP) and solved exactly in exponential time. Many approximation algorithms emerge from the linear programming relaxation of the integer program. Not all approximation algorithms are suitable for all practical applications. They often use IP/LP/Semidefinite solvers, complex data structures or sophisticated algorithmic techniques which lead to difficult implementation problems. Also, some approximation algorithms have impractical running times even though they are polynomial time, for example O(n2000). Yet the study of even very expensive algorithms is not a completely theoretical pursuit as they can yield valuable insights. A classic example is the initial PTAS for Euclidean TSP due to Sanjeev Arora which had prohibitive running time, yet within a year, Arora refined the ideas into a linear time algorithm. Such algorithms are also worthwhile in some applications where the running times and cost can be justified e.g. computational biology, financial engineering, transportation planning, and inventory management. In such scenarios, they must compete with the corresponding direct IP formulations. Another limitation of the approach is that it applies only to optimization problems and not to "pure" decision problems like satisfiability, although it is often possible to conceive optimization versions of such problems, such as the maximum satisfiability problem. Inapproximability has been a fruitful area of research in computational complexity theory since the 1990 result of Feige, Goldwasser, Lovasz, Safra and Szegedy on the inapproximability of Independent Set. After Arora et al. proved the PCP theorem a year later, it has now been shown that Johnson's 1974 approximation algorithms for Max SAT, Set Cover, Independent Set and Coloring all achieve the optimal approximation ratio, assuming PÂ != NP.

## QoS

In the field of computer networking and other packet-switched telecommunication networks, the traffic engineering term quality of service (QoS) refers to resource reservation control mechanisms rather than the achieved service quality. Quality of service is the ability to provide different priority to different applications, users, or data flows, or to guarantee a certain level of performance to a data flow. For example, a required bit rate, delay, jitter, packet dropping probability and/or bit error rate may be guaranteed. Quality of service guarantees are important if the network capacity is insufficient, especially for real-time streaming multimedia applications such as voice over IP, online games and IP-TV, since these often require fixed bit rate and are delay sensitive, and in networks where the capacity is a limited resource, for example in cellular data communication. In the absence of network congestion, QoS mechanisms are not required.

A network or protocol that supports QoS may agree on a traffic contract with the application software and reserve capacity in the network nodes, for example during a session establishment phase. During the session it may monitor the achieved level of performance, for example the data rate and delay, and dynamically control scheduling priorities in the network nodes. It may release the reserved capacity during a tear down phase. A best-effort network or service does not support quality of service. An alternative to complex QoS control mechanisms is to provide high quality communication over a best-effort network by over-provisioning the capacity so that it is sufficient for the expected peak traffic load. In the field of telephony, quality of service was defined in the ITU standard X.902 as "A set of quality requirements on the collective behavior of one or more objects". Quality of Service comprises requirements on all the aspects of a connection, such as service response time, loss, signal-to-noise ratio, cross-talk, echo, interrupts, frequency response, loudness levels, and so on. A subset of telephony QoS is Grade of Service (GOS) requirements, which comprises aspects of a connection relating to capacity and coverage of a network, for example guaranteed maximum blocking probability and outage probability. QoS is sometimes used as a quality measure, with many alternative definitions, rather than referring to the ability to reserve resources. Quality of service sometimes refers to the level of quality of service, i.e. the guaranteed service quality. High QoS is often confused with a high level of performance or achieved service quality, for example high bit rate, low latency and low bit error probability. See also Relation to subjective quality measures below.

## Delay Estimation

## Introduction to the Non-Parametric Estimation of Delay Distribution

The goal of this work is to show how an end-to-end measurement can be used to infer per-link delay in a network. Special attention will be paid to the estimation of the probability distribution of per-link variable delay. The strategic direction is to define a logical model for the physical network, which is called the Tree model.

The focus of the estimate is not the physical propagation delay, because, usually, it does not influence the behavior of the network in a crucial way and is a more manageable value than the additional variable delay attributable to queuing in buffers or other processing in a router.

The inference strategy is aimed at the estimation of the variable delay previously mentioned and is extended from an estimate of end-to-end delays obtained by end-to-end measurements to the events of interest inside the network, such as per-link delays. Knowing these quantities, it is possible to define the delay distribution for each link by using only the measured distributions of end-to-end delay of the multicast or unicast packets.

The next section describes a logical model for studying a network topology, which is called the Tree model. A physical network is replaced by a logical tree composed of a root and the branch nodes that get down from it to the leaf receivers nodes. The root is the source, which sends the packets to a set of receivers, and the end-to-end delay is a measurement of a path from the root to a leaf receiver.

The research of distribution delay of an internal node delay is very complex. In fact, it is obtained by analyzing the different ways in which the end-to-end delay can be split between the portion of the path above or below the node in question. The key assumption is that the per-link delays between different links and packets should be considered independently. The packets are potential subject to queuing and loss over each link. That is why the probability distribution should be estimated along each link.

Due to the fact that the distribution of a link delay in the network is unknown, the characterization of the variable delay is obtained by non-parametric discrete Distributions. It also allows to obtain a broad range of different delay distributions. The model is a discrete model, because the result of the inference is a discrete probability distribution. A discretization of continuous time in a slotted time is made. Each slot consists of a bin time, which can be either fixed or variable. This approach allows to obtain the inference by simply using the algebraic computations and provides the balance between the accuracy of the distribution and the cost of calculation. The cost is inversely proportional to the bin width of the discrete distribution. The model decreases continuously until the null the width of the bin. The application of the inverse Laplace transforms makes the continuous model feasible.

In the following section 3.3 there will be described the algorithm of estimating the per-link discrete distributions by using the measured end-to-end delay distributions only. The model is based on the definition of the tree model and the likelihood function, described in the Section 2.6, under the key assumption of independent delay over each link.

## The Tree Model

The tree model represents a physical network as a graph . denotes the physical nodes such as routers or switches, and defines the link between them. A source sender probe is called a root and is labeled as 0ïƒŽ. A set of receivers is denoted as RïƒŒ. The tree model is defined by the set of paths from the root to each rïƒŽ R and forms a tree ï”phys in.

The tree model is defined as a binary tree, where there is no possibility for two diverged paths to intersect one more time. It is possible to move from a physical model to a logical model, which is more simple to manage and takes into consideration all the characteristics of the physical one. A logical source tree can be defined ï”=(V,L).

Figure 3.1: A logical tree. An ancestor j'>k' and the first common ancestor are defined. f(k') represents the parent of k'.

## Delay model

Delay model is the method to define a delay over the links or a path in a tree model. The node probe is the root. Let <i,j> be a packet pair sent to destination i and j respectively. A packet pair can be described as a train consisting of two carriages, one of which goes behind the other. They cover a common path till a branch node and are directed to nodes i and j. The common path is the sequence of a set of links down to node i v j. Let us denote p(i,j) a sequence of links traversed by at least one of the two members of the packet pair. Let kïƒŽp(i,j) be, and denote S(k)ïƒï»1,2ï½ as the set of packets which across k, where 1 and 2 are two members of packet pairs sent to i and j. , with is observed, and it represents the cumulated delay along the root to node k.

A measurement represents the end-to-end delay from the root to the end receivers i and j. expresses this couple of one way delay. Where is the delay from the root to the destination i for the first member and is the delay from the root to the destination j for the second member. This is the only measurement which can be used and it takes into consideration the definition of the tomography with the active external measurement (see Section 2).

It is also possible to apply a delay model to the packet pairs. Each member of a packet pair traverses a common path to arrive to the respective destination. This common path is vital for the delay model. Let and be a pair of random variable for each node k. and represents the estimated value of delay over a link (f(k),k)ïƒŽL for the first member and for the second one of the packet pair. They can have values in the real line ïƒˆï‚¥. , because a delay cannot be negative. The value ï‚¥ can be assumed if the packet is dropped on a link and is not able to reach the address receiver. For the hypothesis =equals to 0. Two kinds of independence are required for this model: for the delay between different pairs and for the delay within the same pair but over different links. For kïƒŽV, the difference between the delay experienced by the first and the second member of pair crossing k. is a quantity which measures how large is the cumulated delay between two members in k.

Another hypothesis is to consider =0. This is a rough approximation. The practical application shows a different delay andï‚¹0. The state of the network can be not stationary. When a packet is sent, it can meet different states of the network, because it is time-dependent. The first and the second member test the network in different time because they are distanced even if the temporal gap between them is small. For example, a bottleneck can have a different impact on the first and the second member of a packet pair.can never have a null value, even if there is a perfect back-to-back packets, as, for

example, in case of a low traffic state of a network. The second member must wait the transmission of the first one. For this reason there is always a delay which is impossible to avoid.

The goal of the root is to send the pair packets. An experiment consists in sending n packets pairs <i,j> for each pair of distinct receivers i, j ïƒŽR . Let us denote the set of measurements of this experiment by:

where

It is the delay experienced by the m-th packet pair <i,j>. To define the complete set of measurements means to group all the set of measurement for each end receivers i,jïƒŽR

shows how the set of measurementsand the complete set of measurements X are computed.

Figure 3.2: A m-th packet pair is sent to end receiver i and j. The set of measurement for m=1 to n defines. The complete set of measurement X is obtained combining all possible pair of distinct receivers i,j .

## PROBLEM DEFINITION

## PROBLEM DEFINITION :

## 2.1. Existing System:

Existing system uses RTF and RTC built up for discretization error along a path.

Here efficiency of the algorithms directly relates to the magnitude

of the errors introduced during discretization .

## 2.2. Proposed System:

In our project we use two techniques to decrease the discretion error.

Here we use randomized discretization and path delay discretization techniques.

The above new techniques either make the link errors to cancel out each

other along the path or treat the path delay as a whole for discretization,

which results in much smaller errors.

The algorithms based on these techniques run much faster than the best existing algorithm

## HARDWARE AND SOFTWARE

## REQUIREMENT SPECIFICATION

## 3. HARDWARE AND SOFTWARE REQUIREMENTS

## 3.1. HARDWARE:

PROCESSOR : PENTIUM IV 2.6 GHz

RAM : 512 MB DD RAM

MONITOR : 15" COLOR

HARD DISK : 20 GB

CDDRIVE : LG 52X

KEYBOARD : STANDARD 102 KEYS

MOUSE : 3 BUTTONS

## 3.2. SOFTWARE:

FRONT END : JAVA

TOOL USED : JFRAMEBUILDER

OPERATING SYSTEM : WINDOWS XP

BACK END : SQL SERVER 2000

## PROJECT ANALYSIS

## 4. PROJECT ANALYSIS

## Modules:

Design of LAN structure

Finding all possible paths

Time calculation

Random discrimination

## 4.1. Modules Descriptions:

## Design of LAN structure:

Here we design the structure for which the shortest path is to

find .the structure to which we find the shortest path is drawn be

In the data flow diagram.

## Finding all possible paths:

Consider a network, where is a set of nodes and is a set of directed links connecting the nodes. The delay and the cost of a link are denoted as and , respectively. The delay and the cost of a path are denoted as and , respectively. and. Let be the length (number of hops) of , and be the length of the longest path in the network. Given a delay requirement, is called a feasible path if . Given a source node, let be the set of nodes to which there exist feasible paths from . For any , the cheapest feasible path from to is defined as The delay-constrained least-cost routing problem (DCLC) is to find the cheapest feasible paths from to all nodes in which is NP-complete [19]. However, if the link delays are all integers and the delay requirement is bounded by an integer , the problem can be solved in time by Joksch's dynamic programming algorithm [20] or the extended Dijkstra's algorithm [17].Joksch's algorithm is described as follows. , let be a variable storing the cost of the cheapest path from to with , and storing the last link of the path. Initially,and .NIL. Assuming that all link delays are positive, the dynamic programming is given below. Now suppose the link delays are allowed to be zero. We need to add one more step. Let be the sub graph consisting of all zero-delay links. For each , immediately after Joksch's algorithm calculates , Dijkstra's algorithm is executed on to improve on zero-delay paths [18].The above polynomials solvable special case with integer delays points out a heuristic solution for the general NP-complete problem with arbitrary delays. The idea is to discretize (scale and then round) arbitrary link delays to integers [15], [17], [18], [21]. There are two existing discrimination approaches, round to ceiling [17] and round to floor [18]. Both approaches map the delay requirement to a selected integer , and then discretize the link delays as follows.

## Time calculation

RTC creates negative rounding errors on links. The error accumulates along a path. The accumulated error is proportional to the path length. The larger the topology, the longer a path, the larger the accumulated error. The same thing is true for RTF,which has positive rounding errors on links. In order to achieve -approximation, the accumulated error on a path cannot be too large. To reduce the error on a path, the existing algorithms based on RTC or RTF must reduce the discrimination errors on the links by using a large value. Given the time complexity proportion to .The insight is that if we can reduce the error introduced by discretization without using a larger , we can improve the performance of the algorithm.We develop two new techniques. The first one is called randomized discretization. It rounds to ceiling or to floor according to certain probabilities. The idea is for some links to have positive errors and some links to have negative errors. Positive errors and negative errors cancel out one another along a path in such a way that the accumulated error is minimized statistically. We will prove that, when the following discretization approach is used, the mean of the accumulated error on a path is zero and the standard deviation is bounded . In comparison, the mean of the accumulated error is for RTC and for RTF.

## DESIGN

## 4.2. DESIGN

## 4.2.1 UML DIAGRAMS

## USE-CASE DIAGRAM:

## CLASS DIAGRAM:

## SEQUENCE DIAGRAM:

## COLLABORATION DIAGRAM:

## 4.3 DATAFLOW DIAGRAM:

SOURCE n DESTINATION

NODES

Select Source

Find All the Possible paths

Find the Shortest Path with Time Calculation

## Send the File through Shortest Path

## TECHNOLOGIES

## 5. TECHNOLOGIES USED

## 5.1. INTRODUCTION TO JAVA

Java has been around since 1991, developed by a small team of Sun Microsystems developers in a project originally called the Green project. The intent of the project was to develop a platform-independent software technology that would be used in the consumer electronics industry. The language that the team created was originally called Oak.

The first implementation of Oak was in a PDA-type device called Star Seven (*7) that consisted of the Oak language, an operating system called GreenOS, a user interface, and hardware. The name *7 was derived from the telephone sequence that was used in the team's office and that was dialed in order to answer any ringing telephone from any other phone in the office.

Around the time the First Person project was floundering in consumer electronics, a new craze was gaining momentum in America; the craze was called "Web surfing." The World Wide Web, a name applied to the Internet's millions of linked HTML documents was suddenly becoming popular for use by the masses. The reason for this was the introduction of a graphical Web browser called Mosaic, developed by ncSA. The browser simplified Web browsing by combining text and graphics into a single interface to eliminate the need for users to learn many confusing UNIX and DOS commands. Navigating around the Web was much easier using Mosaic.

It has only been since 1994 that Oak technology has been applied to the Web. In 1994, two Sun developers created the first version of Hot Java, and then called Web Runner, which is a graphical browser for the Web that exists today. The browser was coded entirely in the Oak language, by this time called Java. Soon after, the Java compiler was rewritten in the Java language from its original C code, thus proving that Java could be used effectively as an application language. Sun introduced Java in May 1995 at the Sun World 95 convention.

Web surfing has become an enormously popular practice among millions of computer users. Until Java, however, the content of information on the Internet has been a bland series of HTML documents. Web users are hungry for applications that are interactive, that users can execute no matter what hardware or software platform they are using, and that travel across heterogeneous networks and do not spread viruses to their computers. Java can create such applications.

## WORKING OF JAVA

For those who are new to object-oriented programming, the concept of a class will be new to you. Simplistically, a class is the definition for a segment of code that can contain both data and functions.

When the interpreter executes a class, it looks for a particular method by the name of main, which will sound familiar to C programmers. The main method is passed as a parameter an array of strings (similar to the argv[] of C), and is declared as a static method.

To output text from the program, we execute the println method of System. out, which is java's output stream. UNIX users will appreciate the theory behind such a stream, as it is actually standard output. For those who are instead used to the Wintel platform, it will write the string passed to it to the user's program.

## 5.2. SWING

## 1INTRODUCTION TO SWING

Swing contains all the components. It's a big library, but it's designed to have appropriate complexity for the task at hand - if something is simple, you don't have to write much code but as you try to do more your code becomes increasingly complex. This means an easy entry point, but you've got the power if you need it.

Swing has great depth. This section does not attempt to be comprehensive, but instead introduces the power and simplicity of Swing to get you started using the library. Please be aware that what you see here is intended to be simple. If you need to do more, then Swing can probably give you what you want if you're willing to do the research by hunting through the online documentation from Sun.

## BENEFITS OF SWING

Swing components are Beans, so they can be used in any development environment that supports Beans. Swing provides a full set of UI components. For speed, all the components are lightweight and Swing is written entirely in Java for portability.

Swing could be called "orthogonality of use;" that is, once you pick up the general ideas about the library you can apply them everywhere. Primarily because of the Beans naming conventions.

Keyboard navigation is automatic - you can use a Swing application without the mouse, but you don't have to do any extra programming. Scrolling support is effortless - you simply wrap your component in a JScrollPane as you add it to your form. Other features such as tool tips typically require a single line of code to implement.

Swing also supports something called "pluggable look and feel," which means that the appearance of the UI can be dynamically changed to suit the expectations of users working under different platforms and operating systems. It's even possible to invent your own look and feel.

## DEVELOPMENT

## 6. DEVELOPMENT:

## 6.1 CODING:

## Module Coding

## Source Coding

## Node 1

## /****************************************************************/

/* Node1 */

## /* */

## /****************************************************************/

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import javax.swing.event.*;

import java.io.*;

import java.net.*;

import java.sql.*;

## /**

* Summary description for Node1

## *

## */

public class Node1 extends JFrame

## {

// Variables declaration

String destination;

private JTabbedPane jTabbedPane1;

private JPanel contentPane;

## //-----

private JTextField jTextField1;

private JComboBox jComboBox1;

private JTextArea jTextArea3;

private JScrollPane jScrollPane3;

private JLabel jLabel1;

private JLabel jLabel2;

private JLabel jLabel3;

private JButton jButton1;

private JButton jButton2;

private JButton jButton3;

private JButton jButton4;

private JPanel jPanel1;

String str="";

String msg;

String st[]={"Select","Node2","Node3","Node4","Node5"};

String check="FIND PATH",p1,p2;

## //-----

private JTextArea jTextArea1;

private JScrollPane jScrollPane1;

private JPanel jPanel2;

double time,display,calculate;

ResultSet rs;

Socket s2;

Socket s3;

Socket s4;

Socket ss1;

ServerSocket ss;

## //-----

// End of variables declaration

public Node1()

## {

super();

initializeComponent();

## //

// TODO: Add any constructor code after initializeComponent call

## //

this.setVisible(true);

try

## {

ss= new ServerSocket(11);

String path=":Node1";

time=System.nanoTime();

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con=DriverManager.getConnection("jdbc:odbc:path","sa","");

Statement stmt=con.createStatement();

stmt.executeUpdate("truncate table path");

while(true)

## {

ss1=ss.accept();

DataInputStream dis=new DataInputStream(ss1.getInputStream());

display=dis.readDouble();

String check=dis.readUTF();

String dest=dis.readUTF();

String way=check+path;

calculate=time-display;

if(dest.equalsIgnoreCase("Node1"))

## {

//stmt.executeUpdate("truncate table path");

stmt.executeUpdate("insert into path values ('"+way+"','"+calculate+"')");

rs= stmt.executeQuery("select * from path");

jTextArea3.setText("");

while(rs.next())

## {

String p1=rs.getString(1);

String p2=rs.getString(2);

jTextArea3.append("\n------------------------------------\n Path \n----------------------------------\n"+p1+"\nConsumed Time\n"+p2);

## }

//System.out.println(way+"Consumed Time\n"+calculate);

//jTextArea3.append("\n------------------------------------\n Path \n----------------------------------\n"+way+"\nConsumed Time\n"+display);

## }

else

## {

// System.out.println("mike testing 1");

int next[]={22,44,33};

String p[]={"Node2","Node4","Node3"};

int count=0;

String checks[]=check.split(":");

for(int j=0;j<p.length;j++)

## {

for(int i=1;i<checks.length;i++)

## {

if(p[j].equalsIgnoreCase(checks[i]))

## {

count=1;

break;

## }

else

## {

count=0;

## }

## }

if(count==0)

{ s2=new Socket("localhost",next[j]);

DataOutputStream hit=new DataOutputStream(s2.getOutputStream());

hit.writeDouble(calculate);

hit.writeUTF(way);

hit.writeUTF(dest);

## }

## }

## }

## }

## }

catch (Exception e)

## {

e.printStackTrace();

## }

## }

## /**

* This method is called from within the constructor to initialize the form.

* WARNING: Do NOT modify this code. The content of this method is always regenerated

* by the Windows Form Designer. Otherwise, retrieving design might not work properly.

* Tip: If you must revise this method, please backup this GUI file for JFrameBuilder

* to retrieve your design properly in future, before revising this method.

## */

private void initializeComponent()

## {

jTabbedPane1 = new JTabbedPane();

contentPane = (JPanel)this.getContentPane();

## //-----

jTextField1 = new JTextField();

jComboBox1 = new JComboBox(st);

jLabel1=new JLabel();

jLabel1.setFont(new Font("Imprint MT Shadow",Font.PLAIN,12));

jLabel2=new JLabel();

jLabel2.setFont(new Font("Imprint MT Shadow",Font.PLAIN,12));

jLabel3=new JLabel();

jLabel3.setFont(new Font("Imprint MT Shadow",Font.PLAIN,16));

jTextArea3 = new JTextArea();

jScrollPane3 = new JScrollPane();

jButton1 = new JButton();

jButton2 =new JButton();

jButton3 =new JButton();

jButton4 =new JButton();

jPanel1 = new JPanel();

## //-----

jTextArea1 = new JTextArea();

jScrollPane1 = new JScrollPane();

jPanel2 = new JPanel();

## //-----

## //

// jTabbedPane1

## //

addComponent(contentPane, jLabel3, 50,50,83,28);

jLabel3.setText(" FAST COMPUTATION OF SHORTEST PATH");

jTabbedPane1.addTab("Node1", jPanel1);

jTabbedPane1.addTab("Message", jPanel2);

jTabbedPane1.addChangeListener(new ChangeListener() {

public void stateChanged(ChangeEvent e)

## {

jTabbedPane1_stateChanged(e);

## }

## });

## //

// contentPane

## //

contentPane.setLayout(null);

addComponent(contentPane, jTabbedPane1, 21,71,524,408);

## //

// jTextField1

## //

jTextField1.setText("");

jTextField1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

## {

jTextField1_actionPerformed(e);

## }

## });

## //

// jComboBox1

## //

jComboBox1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

## {

jComboBox1_actionPerformed(e);

## }

## });

jButton1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

## {

jButton1_actionPerformed(e);

## }

## });

jButton2.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

## {

jButton2_actionPerformed(e);

## }

## });

jButton3.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

## {

jButton3_actionPerformed(e);

## }

## });

jButton4.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

## {

jButton4_actionPerformed(e);

## }

## });

## //

// jTextArea3

## //

jTextArea3.setText("");

## //

// jScrollPane3

## //

jScrollPane3.setViewportView(jTextArea3);

## //

// jButton1

## //

//jButton1.setText("jButton1");

jButton1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e)

## {

jButton1_actionPerformed(e);

## }

## });

## //

// jPanel1

## //

jPanel1.setLayout(null);

jPanel1.setBackground(new Color(168,221,255));

jPanel2.setBackground(new Color(168,221,255));

addComponent(jPanel1, jTextField1, 19,79,150,29);

addComponent(jPanel1, jComboBox1,180,150,95,28);

addComponent(jPanel1, jScrollPane3, 310,90,184,250);

addComponent(jPanel1, jLabel1, 353,50,83,28);

addComponent(jPanel1, jLabel2, 24,145,100,28);

addComponent(jPanel1, jButton1, 105,205,145,28);

addComponent(jPanel1, jButton2,180,80,95,28);

addComponent(jPanel1, jButton3, 105,255,145,28);

addComponent(jPanel1, jButton4, 105,305,145,28);

addComponent(contentPane, jLabel3, 100,23,380,27);

## //

## //

## //

// jTextArea1

## //

//jTextArea1.setText();

jLabel1.setText("TIMINGS");

jLabel2.setText("DESTINATION");

jButton1.setText("FIND PATH");

jButton2.setText("BROWSE");

jButton3.setText("SEND");

jButton4.setText("EXIT");

## //

// jScrollPane1

## //

jScrollPane1.setViewportView(jTextArea1);

## //

// jPanel2

## //

jPanel2.setLayout(null);

addComponent(jPanel2, jScrollPane1, 39,36,430,310);

## //

// Node1

## //

this.setTitle("Node1 - extends JFrame");

this.setLocation(new Point(0, 0));

this.setSize(new Dimension(589, 553));

## }

/** Add Component Without a Layout Manager (Absolute Positioning) */

private void addComponent(Container container,Component c,int x,int y,int width,int height)

## {

c.setBounds(x,y,width,height);

container.add(c);

## }

## //

// TODO: Add any appropriate code in the following Event Handling Methods

## //

private void jTabbedPane1_stateChanged(ChangeEvent e)

## {

System.out.println("\njTabbedPane1_stateChanged(ChangeEvent e) called.");

// TODO: Add any handling code here

## }

private void jTextField1_actionPerformed(ActionEvent e)

## {

System.out.println("\njTextField1_actionPerformed(ActionEvent e) called.");

// TODO: Add any handling code here

## }

private void jComboBox1_actionPerformed(ActionEvent e)

## {

//System.out.println("\njComboBox1_actionPerformed(ActionEvent e) called.");

## }

private void jButton1_actionPerformed(ActionEvent e)

## {

destination =""+jComboBox1.getSelectedItem();

try

## {

String path="path:Node1";

time=System.nanoTime();;

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con=DriverManager.getConnection("jdbc:odbc:path","sa","");

Statement stmt=con.createStatement();

stmt.executeUpdate("truncate table path");

if(destination.equalsIgnoreCase("Node1"))

{ System.out.println("test");

## }

else{

int port[]={22,33,44};

for(int i=0;i<port.length;i++)

## {

s2=new Socket("localhost",port[i]);

DataOutputStream di=new DataOutputStream(s2.getOutputStream());

di.writeUTF("path");

di.writeDouble(time);

di.writeUTF(path);

di.writeUTF(destination);

System.out.println("Message Forward to "+port[i]+"....");

## }

## }

## }

catch (Exception exp)

## {

exp.printStackTrace();

## }

## }

private void jButton2_actionPerformed(ActionEvent e)

## {

try

## {

FileDialog o= new FileDialog(this,"open",FileDialog.LOAD);

o.show();

File fi=new File(o.getDirectory()+o.getFile());

FileReader fr=new FileReader(fi);

BufferedReader br=new BufferedReader(fr);

while((msg=br.readLine())!=null)

## {

str+=msg;

## }

System.out.println("----->"+str);

jTextField1.setText( ""+o.getDirectory()+o.getFile());

## }

catch (Exception e1)

## {

## }

## }

private void jButton3_actionPerformed(ActionEvent e)

## {

try

## {

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con=DriverManager.getConnection("jdbc:odbc:path","sa","");

Statement stmt=con.createStatement();

String destination=""+jComboBox1.getSelectedItem();

ResultSet rs=stmt.executeQuery("select portno from port where path='"+destination+"'");

String portno="";

while(rs.next())

## {

portno=rs.getString(1);

## }

int por=Integer.parseInt(portno);

Socket s=new Socket("localhost",por);

DataOutputStream dos=new DataOutputStream(s.getOutputStream());

dos.writeUTF("send");

dos.writeUTF(str);

## }

catch (Exception eee)

## {

eee.printStackTrace();

## }

## }

private void jButton4_actionPerformed(ActionEvent e)

## {

System.exit(0);

## }

## }

## }

## TESTING

## 7. TESTING

Testing is a process of executing a program with the intent of finding an error. A good test case is one that has a high probability of finding an as-yet -undiscovered error. A successful test is one that uncovers an as-yet- undiscovered error. System testing is the stage of implementation, which is aimed at ensuring that the system works accurately and efficiently as expected before live operation commences. It verifies that the whole set of programs hang together. System testing requires a test consists of several key activities and steps for run program, string, system and is important in adopting a successful new system. This is the last chance to detect and correct errors before the system is installed for user acceptance testing.

The software testing process commences once the program is created and the documentation and related data structures are designed. Software testing is essential for correcting errors. Otherwise the program or the project is not said to be complete. Software testing is the critical element of software quality assurance and represents the ultimate the review of specification design and coding. Testing is the process of executing the program with the intent of finding the error. A good test case design is one that as a probability of finding a yet undiscovered error. A successful test is one that uncovers a yet undiscovered error. Any engineering product can be tested in one of the two ways:

## 7.1. WHITE BOX TESTING

This testing is also called as Glass box testing. In this testing, by knowing the specific functions that a product has been design to perform test can be conducted that demonstrate each function is fully operational at the same time searching for errors in each function. It is a test case design method that uses the control structure of the procedural design to derive test cases. Basis path testing is a white box testing.

Basis path testing:

Flow graph notation

Cyclometric complexity

Deriving test cases

Graph matrices Control

## 7.2. BLACK BOX TESTING

In this testing by knowing the internal operation of a product, test can be conducted to ensure that "all gears mesh", that is the internal operation performs according to specification and all internal components have been adequately exercised. It fundamentally focuses on the functional requirements of the software.

The steps involved in black box test case design are:

Graph based testing methods

Equivalence partitioning

Boundary value analysis

Comparison testing

## 7.3. PROGRAM TESTING:

The logical and syntax errors have been pointed out by program testing. A syntax error is an error in a program statement that in violates one or more rules of the language in which it is written. An improperly defined field dimension or omitted keywords are common syntax error. These errors are shown through error messages generated by the computer. A logic error on the other hand deals with the incorrect data fields, out-off-range items and invalid combinations. Since the compiler s will not deduct logical error, the programmer must examine the output. Condition testing exercises the logical conditions contained in a module. The possible types of elements in a condition include a Boolean operator, Boolean variable, a pair of Boolean parentheses A relational operator or on arithmetic expression. Condition testing method focuses on testing each condition in the program the purpose of condition test is to deduct not only errors in the condition of a program but also other a errors in the program.

## 7.4. VERIFICATION TESTING

At the culmination of integration testing, software is completely assembled as a package. Interfacing errors have been uncovered and corrected and a final series of software test-validation testing begins. Validation testing can be defined in many ways, but a simple definition is that validation succeeds when the software functions in manner that is reasonably expected by the customer. Software validation is achieved through a series of black box tests that demonstrate conformity with requirement. After validation test has been conducted, one of two conditions exists.

* The function or performance characteristics confirm to specifications and are accepted.

* A validation from specification is uncovered and a deficiency created.

Deviation or errors discovered at this step in this project is corrected prior to completion of the project with the help of the user by negotiating to establish a method for resolving deficiencies. Thus the proposed system under consideration has been tested by using validation testing and found to be working satisfactorily. Though there were deficiencies in the system they were not catastrophic.

## RESULT & ANALYSIS

## 8. RESULT AND ANALYSIS:

## CONCLUSION

## CONCLUSIONS:

In this paper, we proposed two techniques, randomized discretization and path delay discretization, to design fast algorithms for computing constrained shortest paths.

While the previous approaches (RTF and RTC) build up the discretization error along a path, the new techniques either make the link errors to cancel out each other along the path or treat the path delay as a whole for discretization, which results in much smaller errors.

The algorithms based on these techniques run much faster than the best existing algorithm that solves the -approximation of DCLC.