internship project report - vaibhav

39
Project Report Developing a tool to calculate Indicators which characterize Spatial Networks Vaibhav Dhattarwal CSE IDD 4 th Year 08211018 During Internship period of May 27, 2012- July 13, 2012 This report was prepared during my internship at ESTP Paris, France. 1 IIT ROORKEE Vaibhav Dhattarwal( Internship at ESTP Paris)

Upload: vaibhav-dhattarwal

Post on 26-Jan-2017

191 views

Category:

Documents


11 download

TRANSCRIPT

Page 1: Internship Project Report - Vaibhav

Project Report

Developing a tool to calculate Indicators which characterize Spatial Networks

Vaibhav Dhattarwal

CSE IDD

4th Year

08211018

During Internship period of May 27, 2012-July 13, 2012

This report was prepared during my internship at ESTP Paris, France.

1 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 2: Internship Project Report - Vaibhav

Table of Contents2 IIT ROORKEE

Vaibhav Dhattarwal( Internship at ESTP Paris)

Page 3: Internship Project Report - Vaibhav

Summer Internship Certificate 2

Preface4

Acknowledgement 5

About ESTP 6

1. About Project 7

1.1 Motivation for the Project 8

1.2 A tool to calculate indicators which characterize Spatial Networks 9

2. Spatial Networks 10

2.1 Networks and Space, Degree in Networks and Graphs 10

2.2 Geometric Primitives used in planar Spatial Networks 11

3. Development of Project Structure 12

3.1 Initially Proposed Structure 12-13

3.2 Flow Diagram of Project Structure 14-16

4. Implementation of Indicators 17

4.1 Model for Indicators 17

4.2 Description of Selected Indicators 18-19

5. Writing the Program Source Code 20

5.1 Input of Network Graph data 20

5.2 Execution of Program and Description of Functions used 21-23

5.3 Output Results obtained after Execution 24-26

6. Conclusions of the Project 27

List of References 28

3 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 4: Internship Project Report - Vaibhav

PREFACE

This report is to be submitted to ESTP Paris and Indian Institute of Technology Roorkee.

This report is intended to provide a brief overview of the research based summer internship

which I performed during the break after the spring semester.

The summer internship is meant to increase the interaction of the students with international

institutions and to strengthen the ties between the institutes.

4 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 5: Internship Project Report - Vaibhav

ACKNOWLEDGEMENT

This project could not have been completed without the help and support of Mrs. Patricia

Bordin, who not only served as my supervisor and guide but also encouraged and challenged

me throughout my project. She guided me through various tasks of my project, through

regular discussions on various stages of the project and instructing me how to proceed

further, never accepting less than my best efforts. I would also like to thank the people at

ESTP who worked in the Centre of Research Lab and helped me during my stay.

5 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 6: Internship Project Report - Vaibhav

About ESTP:

Fig 1.1: ESTP Logo

The Ecole Spéciale des Travaux Publics, du Bâtiment et de l’Industrie (ESTP) was founded

in 1891 as a private higher education institution and officially recognized by the State in

1921. In France, the ESTP has the biggest student flow for the construction industry and has

made its reputation as THE “Grande Ecole” for professionals in this area, in all its aspects:

design, planning & development, construction, project management, rehabilitation,

maintenance, facilities & real estate management, …with an emphasis on sustainable

development, new materials, energy efficiency, health issues, saving of natural resources, …

Today, the ESTP is the French institution that trains the largest number of students for the

construction industry in all fields: design, construction, planning & development, project &

facilities management, sustainable buildings & infrastructures, rehabilitation, maintenance,

new materials, energy efficiency.

Its expertise ranges from degree awarding programmes (at all levels of higher education,

from 2 year technician courses to PhDs) to adult education and intensive sessions of French

as a foreign language.

One of the main characteristics of the ESTP is its close relationship to industry; many

renowned companies are its active partners. This privileged partnership is confirmed on a

daily basis by a large offer of internships, sponsoring of events, scholarships for students,

participation in ESTP boards, … These links are strengthened by the 1.400 adults who

participate each year in a continuing education programme and by the 18.000 alumni of the

engineering degree course who are practicing professionals and may be found in small,

medium and big sized construction companies all over the world.

6 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 7: Internship Project Report - Vaibhav

1. ABOUT PROJECT

Introduction

During my intern at ESTP, I was assigned the task of developing a tool to calculate indicators

which characterize spatial networks. In the beginning, I was asked to study the research paper

“Spatial Networks” by Marc Barthelemy. After gaining a basic understanding of Spatial

Networks from the paper, I proposed a new project structure according to the details provided

to me by my guide, Patricia Bordin.

The proposed project is to exploit the theoretical knowledge in morphology and topology

mathematics and to build indicators to characterize and discriminate the different types of

utility networks; and then to test and apply these indicators to data bases on actual networks.

Using the knowledge gained from the research paper and the newly constructed flow diagram

representation of the project structure, I began working on the first stage of the project which

was to design the program by creating a list of possible indicators that could be implemented

in the program. However after a discussion with Marc and Patricia, only some indicators

were finalized to be implemented in the program.

I wrote the program code and created several functions to calculate the selected indicators.

After receiving the input spatial network graphs and the input text coordinate files, I wrote

the functions to convert the file to an object in the program and perform functions on the data.

The output was obtained after removing errors (debugging) and written as output text files.

In this project report, I begin by explaining the motivation for the project and some basics

features of spatial networks. Moving on, I present the proposed project structure and flow

diagram prepared by me, followed by the explanation of the selected indicators. After that I

explain how the program code was written and how the input was processed to generate

output. I finish with the conclusions obtained so far by the project.

7 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 8: Internship Project Report - Vaibhav

1.1 Motivation for the project

Utility Systems are widespread and form an integral part of the majority of activities,

communications, tasks and services today. Many of these systems are very often organized

under the form of networks where nodes and edges are embedded in space. Transportation

and mobility networks, Internet, mobile phone networks, power grids, social and contact

networks, neural networks, are all examples where space is relevant and where topology

alone does not contain all the information. Characterizing and understanding the structure and

the evolution of spatial networks is thus crucial for many different fields.

Fig 1.2: Utility Network

Some of the older networks lack proper structure and it often creates difficulty in failure

resolution as well as their recreation or expansion. The tool which we intend to create can be

extremely valuable in such situations, as it incorporates design elements which focus on

prediction of network structure. Another important feature is that the tool can be continuously

improved by comparing the predicted results with the actual structure and modifying the

design elements to improve the accuracy of the results.

8 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 9: Internship Project Report - Vaibhav

1.2 A tool to calculate indicators which characterize spatial networks

Spatial Networks can be characterized by comparing the results obtained from calculating

various indicators, and using those results we can define some rules to predict for localization

of missing parts of the network.

In order to calculate those indicators, our tool must have in built functions that are

implementation of the definition of the corresponding indicators. The tool must also be able

to simultaneously take input several data sets and convert them into appropriate parameters

for the functions to execute.

The geometric and topological components can be combined with the semantic component to

improve the rule set and prediction making by introducing a feedback system which can be

used to modify the function definition or add more functions to the tool design.

Fig 1.3: Program to calculate indicators for spatial networks.

9 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 10: Internship Project Report - Vaibhav

2. Spatial Networks

Spatial Networks are networks for which the nodes are located in a space equipped with a metric. For most practical applications, the space is the two dimensional space and the metric is the usual Euclidean distance.

It is not necessary for a Spatial Network to be planar. Spatial Networks can be planar as well as non planar.

Fig 2.1: Non Planar Spatial Network

2.1 Networks and Space, Degree in networks and graphs

Networks have nodes and edges which are constrained by some geometry and are usually embedded in a two dimensional space and this has important effects on their topological properties and consequently on processes which take place on them.

The topological aspects of the network are then correlated to the spatial aspects such as the location of the nodes and the length of the edges.

In the study of graphs and networks, the degree of a node (v) in a network is the number of connections it has to other nodes.

10 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 11: Internship Project Report - Vaibhav

2.2 Geometric Primitives used in planar Spatial Networks

Point

The points represent the nodes in planar spatial networks

Line

A line represents a connection between two nodes of a planar spatial network.

Polyline

A polyline represents a connection between two nodes with several intermediate points in between joined by lines.

3. Development of Project Structure

3.1 Initially Proposed Structure11 IIT ROORKEE

Vaibhav Dhattarwal( Internship at ESTP Paris)

Page 12: Internship Project Report - Vaibhav

Fig 3.1: Proposed Structure Part 1

The data set for a selected utility networks as given as input to the tool and the first task of the program is to convert the input into function parameters for calculation of indicators.

The geometric and topological components which we already know are processed and compared with the function results in order to identify the structure of the utility network.

A characterization of the network is established using the rule set for geometric and topological components and the identified network can now be expanded and resolved.

12 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 13: Internship Project Report - Vaibhav

Fig 3.2: Proposed Structure Part 2

The first part of the proposed structure dealt with development of indicators and

characterization of indicators. The second part deals with prediction of missing parts of the

network and improving the rule set used for characterization and prediction as well as

improving the accuracy of the predictions.

As the tool is capable of taking multiple input data sets at the same time, the defined and

identified networks are compared with each other. Using the rule set characteristics feature of

networks, the missing parts of the networks can be predicted from the patterns associated

with the corresponding network.

In the final phase, the semantic component is introduced and the resulting set of complete

components can be used to improve the rule set and predication component.

13 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 14: Internship Project Report - Vaibhav

3.2 Flow Diagram of Project Structure

Fig 3.3: Flow Diagram Phase 1

3.2.1 Phase One

Multiple data sets are given to the program to be executed in parallel, and a list of indicators is prepared to be converted to functions of the tool.

The tool executes on the multiple data sets and the functions are written for the selected indicators. These functions are components of the program which is executing.

The results generated by the indicators are used in characterizing the network whose input data sets are given to the tool.

The network characteristics are compared with the characteristics of other networks in order to define and identify the network in an improved manner.

The analysis of this comparison is used to establish principal rules for the given network. The principal rules help in generating the basic framework and behavior for the network.

The principal rules created are used in phase 2 of the project.

14 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 15: Internship Project Report - Vaibhav

Fig 3.4: Flow Diagram Phase 2

3.2.2 Phase Two

The testing of the network is done by the principle rules established in the previous step.

Simultaneously, a set of new rules is formed to perform predictions for the localization of the

network.

The principal and deduced rules are used to make predictions for the part of the network

which is missing or needs to be recreated.

The actual network data is used to test the prediction made by the program, and the extent of

accuracy of the prediction is used in phase three.

15 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 16: Internship Project Report - Vaibhav

Fig 3.5: Flow Diagram Phase 3

3.2.3 Phase Three

In phase three, the semantic component of the network is introduced and its specifications are

given to the program.

The characterization of the network is done by using all the three components: geometric,

semantic and topological.

The generated network characteristics are used to deduce the rules for the network which end

up giving the complete rule set for the network.

3.2.4 Feedback

The first feedback loop occurs when the program is comparing the characteristics of the

networks. This feedback helps in improving the list of indicators and in selecting them.

The second feedback loop occurs in phase two when the prediction is tested with the actual

network. This feedback helps in selecting those indicators who have practical application.

The third feedback loop occurs in phase three when we are deducing rules using all three

components. It helps in forming a new set of rules along with the principal rules.

16 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 17: Internship Project Report - Vaibhav

4. Implementation of Indicators

The indicators that were selected for implementation:

Degree of the Node.

Displacement between any two nodes.

Distance covered while traversing intermediate points between two nodes.

Route Factor for a Network Segment.

Conversion to Binary Tree.

Strahler Index for a tree.

Asymmetry Factor for a tree.

4.1 Model for Indicators

In the model given below (Fig 4.1), Node Ni represents the starting node for a network

segment which is being analyzed by the program and Node Nf represents the ending node

of the network segment. The shape of the model corresponds to a polyline structure where

the Nodes N1-N8 corresponds to intermediate points for the concerned network segment.

Some of the indicators do not require intermediate points in the network segment

information as they are not concerned with topological information. However some

complex indicators require information about the intermediate points for their

computation.

Fig 4.1: Graph Model for indicators

17 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 18: Internship Project Report - Vaibhav

4.2 Description of Selected Indicators

4.2.1 Route Factor:

Route Factor can be defined for a network segment as the ratio of the total distance covered

from the starting to the ending point while covering all the intermediate points, to the length

of the segment. The route factor (also called the detour index or the circuitry or directness)

For a pair of nodes (I, J) is then given by

Q(I, J)=dR(I, J)/dE(I, J)

This ratio is always larger than one and the closer to one, the more efficient the network.

4.2.2 Binary Tree:

A binary tree (Fig 4.2) is a tree data structure in which each node has at most two child

nodes, usually distinguished as ‘left’ and ‘right’. Nodes with children are parent nodes, and

child nodes may contain references to their parents. Outside the tree, there is often a reference

to the ‘root’ node (the ancestor of all nodes) if it exists. Any node in the data structure can be

reached by starting at root node and repeatedly following references to either left or right

child.

Fig 4.2: Binary Tree

4.2.3 Strahler Index: 18 IIT ROORKEE

Vaibhav Dhattarwal( Internship at ESTP Paris)

Page 19: Internship Project Report - Vaibhav

It is represented as λ, and is a measure of graph complexity.

λ for a leaf is 0.

λ for a vertex is given as:

λ=max (λ1, λ2) + δ (λ1, λ2)

Where

δ = 1; if λ1 = λ2

δ = 0; if λ1 != λ2

4.2.4 Asymmetry Factor:

Asymmetry factor(As) describes relative differences in degrees of the two subtrees at a vertex.

Left Subtree (lj) and Right Subtree (rj)

As = (lj-rj) ∕ (lj +rj)

5. Writing the Program Source Code

19 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 20: Internship Project Report - Vaibhav

5.1 Input of Network Graph Data

Fig 5.1: Input Network Graph Image; Input Graph Text File

The input network graph is obtained in an image file (Fig 5.1) with the graph information in a

text file. The above shown graph is for a Heat Network.

Once the input text file is received, it must be taken as input by the program and only relevant

information must be there in the input file so that the program can automatically read it on

calling.

Irrelevant information is removed from the input text file and it is placed appropriately for the

program to read from.

The format of the input file is:

Index X-Coordinate 1 Y-Coordinate 1 X-Coordinate 2 Y-

Coordinate 2

The program reads the input file format and stores it in network part structures.

5.2 Execution of program and Description of Functions used

20 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 21: Internship Project Report - Vaibhav

Fig 5.2: Structure for Network Part and Class creation for a network graph

The network part structure stores the input file format and the class network part is created. The class has several network part structures and functions for calculation of indicators.

Fig 5.3: The calculate degree function for the class network graph

The calculate degree function reads the input file format, calculates the degree for both set of coordinates in the network graph and writes the calculated output to an output text file.

21 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 22: Internship Project Report - Vaibhav

Fig 5.4: The input file to structure function for the class network graph

The input file to structure function reads the input text file format and stores the corresponding data into the arguments of the network part sturcutre.

Fig 5.5: The calculate distance graph function for the class network graph

The calculate distance graph function reads the two set of coordinates in every line of the input text file, calculates the distance between the points and writes to output text file.

22 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 23: Internship Project Report - Vaibhav

Fig 5.6: The calculate route factor function for the class network graph

The calculate route factor function opens two input files, from the first it reads the coordinates of the two points and calculates the displacement, and from the second it reads the corresponding distance and then calculates route factor and writes to output text file.

Fig 5.7: The main executable for the program where all the functions are called.

5.3 Output Results obtained after execution.23 IIT ROORKEE

Vaibhav Dhattarwal( Internship at ESTP Paris)

Page 24: Internship Project Report - Vaibhav

Fig 5.8: The output binary tree for the heat network graph.

The above figure is a representation of the heat network graph as a binary tree structure.

The terminal nodes are shown in red and have degree 1.

The junction nodes are shown as yellow and have degree 2.

The other nodes are shown as green and have two child nodes and hence degree 3.

The connections between the nodes are shown as blue lines.

24 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 25: Internship Project Report - Vaibhav

Fig 5.9: The Output graph degree text file; Output graph route factor text file.

The calculate degree function of the network graph class generates the output graph degree file when called.

The degree for both points of a network part is calculated by the calculate degree point function.

The output file format is:

Counter X-Coordinate 1 Y-Coordinate 1 Degree 1 X-Coordinate 2Y-Coordinate 2 Degree 2.

The calculate route factor function of the network graph class generates the output graph route factor file when called.

The output file format is:

Counter Index Distance Displacement Route Factor

25 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 26: Internship Project Report - Vaibhav

Fig 5.10: The Output Graph Distance Text File

The calculate distance graph function of the network graph class generates the output graph distance file when called.

The output file format is:

Counter Index X-Coordinate 1 Y-Coordinate 1 X-Coordinate 2Y-Coordinate 2 Displacement

26 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 27: Internship Project Report - Vaibhav

6. Conclusions of the Project

The program was developed and the code was executed on multiple data sets.

The program was successful in processing three network graphs: Heat Network graph,

Pipe Network Graph, Water Pipe Network Graph.

The indicator functions for calculating degree, distance and route factor were effective

for all input data sets.

The binary tree function was able to convert the heat network graph to a binary tree.

The program has a modular structure, and every function is executing successfully

and we can add more indicator functions to it.

27 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)

Page 28: Internship Project Report - Vaibhav

List of References

[1] ESTP Paris (http://www.estp.fr/en/)

[2]Marc Barthelemy “Spatial Networks”

[3]Wikipedia (www.wikipedia.org/)

[4]C Plus Plus (http://www.cplusplus.com/)

[5]Stack Overflow (http://stackoverflow.com/)

[6]Prezi(www.prezi.com)

[7]ElectroFriends(www.electrofriends.com)

28 IIT ROORKEEVaibhav Dhattarwal( Internship at ESTP Paris)