A graph G consists of a non empty set V called the set of nodes (points, vertices) of the graph, a set E, which is the set of edges of the graph and a mapping from the set of edges E to a pair of elements of V.
Any two nodes, which are connected by an edge in a graph are called "adjacent nodes".
In a graph G(V,E) an edge which is directed from one node to another is called a "directed edge", while an edge which has no specific direction is called an "undirected edge". A graph in which every edge is directed is called a "directed graph" or a "digraph". A graph in which every edge is undirected is called an "undirected graph".
If some of edges are directed and some are undirected in a graph then the graph is called a "mixed graph".
Any graph which contains some parallel edges is called a "multigraph".
If there is no more than one edge but a pair of nodes then, such a graph is called "simple graph."
A graph in which weights are assigned to every edge is called a "weighted graph".
In a graph, a node which is not adjacent to any other node is called "isolated node".
A graph containing only isolated nodes is called a "null graph". In a directed graph for any node v the number of edges which have v as initial node is called the "outdegree" of the node v. The number of edges to have v as their terminal node is called the "Indegree" of v and Sum of outdegree and indegree of a node v is called its total degree.
Content of slide
Tree
Binary tree Implementation
Binary Search Tree
BST Operations
Traversal
Insertion
Deletion
Types of BST
Complexity in BST
Applications of BST
Merge sort is a sorting technique based on divide and conquer technique. With worst-case time complexity being Ο(n log n), it is one of the most respected algorithms.
Merge sort first divides the array into equal halves and then combines them in a sorted manner.
Content of slide
Tree
Binary tree Implementation
Binary Search Tree
BST Operations
Traversal
Insertion
Deletion
Types of BST
Complexity in BST
Applications of BST
Merge sort is a sorting technique based on divide and conquer technique. With worst-case time complexity being Ο(n log n), it is one of the most respected algorithms.
Merge sort first divides the array into equal halves and then combines them in a sorted manner.
Hashing is the process of converting a given key into another value. A hash function is used to generate the new value according to a mathematical algorithm. The result of a hash function is known as a hash value or simply, a hash.
Sorting is any process of arranging items systematically, and has two common, yet distinct meanings: ordering: arranging items in a sequence ordered by some criterion; categorizing: grouping items with similar properties.Common sorting algorithms. Sorting algorithm
Bubble/Shell sort: Exchange two adjacent elements if they are out of order. Repeat until array is sorted.
Insertion sort: Scan successive elements for an out-of-order item, then insert the item in the proper place.
Selection sort: Find the smallest (or biggest) element in the array, and put it in the proper place. Swap it with the value in the first position. Repeat until array is sorted.
Quick sort: Partition the array into two segments. In the first segment, all elements are less than or equal to the pivot value. In the second segment, all elements are greater than or equal to the pivot value. Finally, sort the two segments recursively.
'Merge sort': Divide the list of elements in two parts, sort the two parts individually and then merge it.
Traversal is a process to visit all the nodes of a tree and may print their values too. Because, all nodes are connected via edges (links) we always start from the root (head) node. That is, we cannot randomly access a node in a tree.
Divide and Conquer Algorithms - D&C forms a distinct algorithm design technique in computer science, wherein a problem is solved by repeatedly invoking the algorithm on smaller occurrences of the same problem. Binary search, merge sort, Euclid's algorithm can all be formulated as examples of divide and conquer algorithms. Strassen's algorithm and Nearest Neighbor algorithm are two other examples.
Hashing is the process of converting a given key into another value. A hash function is used to generate the new value according to a mathematical algorithm. The result of a hash function is known as a hash value or simply, a hash.
Sorting is any process of arranging items systematically, and has two common, yet distinct meanings: ordering: arranging items in a sequence ordered by some criterion; categorizing: grouping items with similar properties.Common sorting algorithms. Sorting algorithm
Bubble/Shell sort: Exchange two adjacent elements if they are out of order. Repeat until array is sorted.
Insertion sort: Scan successive elements for an out-of-order item, then insert the item in the proper place.
Selection sort: Find the smallest (or biggest) element in the array, and put it in the proper place. Swap it with the value in the first position. Repeat until array is sorted.
Quick sort: Partition the array into two segments. In the first segment, all elements are less than or equal to the pivot value. In the second segment, all elements are greater than or equal to the pivot value. Finally, sort the two segments recursively.
'Merge sort': Divide the list of elements in two parts, sort the two parts individually and then merge it.
Traversal is a process to visit all the nodes of a tree and may print their values too. Because, all nodes are connected via edges (links) we always start from the root (head) node. That is, we cannot randomly access a node in a tree.
Divide and Conquer Algorithms - D&C forms a distinct algorithm design technique in computer science, wherein a problem is solved by repeatedly invoking the algorithm on smaller occurrences of the same problem. Binary search, merge sort, Euclid's algorithm can all be formulated as examples of divide and conquer algorithms. Strassen's algorithm and Nearest Neighbor algorithm are two other examples.
Graphs are propular to visualize a problem . Matrix representation is use to convert the graph in a form that used by the computer . This will help to get the efficent solution also provide a lots of mathematical equation .
As you know Sci Hub is sometimes down due to some technical issue, So you can visits the new Sci Hub New Domain with its Extension. ThesisScientist.com is New domain alternative of Sci Hub.
If Sci Hub website not working properly than you will move toward to others websites like ThesisScientist.com. It is the best website for downloading free papers and thesis and Free Journals
Computer network is a distributed system consisting of loosely coupled computers and other
devices. Any two of these devices, which we will from now on refer to as network elements or
transmitting elements, can communicate with each other through a communication medium. In
order for these connected devices to be considered a communicating network, there must be a set
of communicating rules or protocols each device in the network must follow to communicate wit
another device in the network. The resulting combination consisting of hardware and software is a computer communication network or computer network in short. Figure 1.1 shows a computer
network
Java is a general-purpose; object oriented programming language developed by Sun Microsystems of USA in 1991. This language was initially called “Oak” by James Gosling, but was renamed “Java” in 1995. Java (with a capital J) is a high-level, third generation programming language, like C, Fortran, Smalltalk, Perl, and many others.Java was initially designed to solve on a small scale could also be applied to the Internet on a large scale. This realization caused the focus of Java to switch from consumer electronic to Internet Programming.Java was designed for the development of software for consumer electronic devices like TVs, VCRs, Toasters, Microwaves ovens and such other electronics devices.Java is a first programming language that is not tied to any particular hardware or operating system. Programs developed in Java can be executed anywhere on any system.
Project Evaluation and Estimation in Software DevelopmentProf Ansari
Cost-benefit analysis
It mainly comprise two steps
Identify and estimating all of the costs and benefits of carrying out the project and operating the delivered application.
Expressing these costs and benefits in common units
We need to evaluate the net benefit, that is, the difference between the total benefit and the total benefit and the total cost of creating and operating the system.
We can categorize cost according to where they originate in the life of the project.
Stepwise Project planning in software developmentProf Ansari
The following activities are:
Identify objectives and practical measures of the effectiveness in meeting those objectives.
Establish a project authority
Stakeholder analysis – identify all stakeholders in the project and their interests
Modify objectives in the light of stakeholder’s analysis
Establish methods of communication with all parties
2.4
Entity Integrity Constraint:
It states that in a relation no attribute of a primary key (K) can have a null value. If a K consists of a single attribute, this constraint obviously applies on this attribute, so it cannot have the Null value. However, if a K consists of multiple attributes, then none of the attributes of this K can have the Null value in any of the instances.
Referential Integrity Constraint :
This constraint is applied to foreign keys. Foreign key is an attribute or attribute combination of a relation that is the primary key of another relation. This constraint states that if a foreign key exists in a relation, either the foreign key value must match the primary key value of some tuple in its home relation or the foreign key value must be completely null.
Normalisation in Database management System (DBMS)Prof Ansari
Normalization is a technique to organize the contents of the table for transactional database and data warehouse.
First Normal Form :
Seeing the data in the example in the book or assuming otherwise that all attributes contain the atomic value, we find out the table is in the 1NF.
Second Normal Form :
Seeing the FDs, we find out that the K for the table is a composite one comprising of empId, projName. We did not include the determinant of fourth FD, that is, the empDept, in the PK because empDept is dependent on empId and empID is included in our proposed PK. However, with this PK (empID, projName) we have got partial dependencies in the table through FDs 1 and 3 where we see that some attributes are being determined by subset of our K which is the violation of the requirement for the 2NF. So we split our table based on the FDs 1 and 3 as follows :
It is a semantic data model that is used for the graphical representation of the conceptual database design. The semantic data models provide more constructs that is why a database design in a semantic data model can contain/represent more details. With a semantic data model, it becomes easier to design the database, at the first place, and secondly it is easier to understand later. We also know that conceptual database is our first comprehensive design. It is independent of any particular implementation of the database, that is, the conceptual database design expressed in E-R data model can be implemented using any DBMS. For that we will have to transform the conceptual database design from E-R data model to the data model of the particular DBMS. There is no DBMS based on the E-R data model, so we have to transform the conceptual database design anyway.
The schemas as it has been defined already; is the repository used for storing definitions of the structures used in database, it can be anything from any entity to the whole organization. For this purpose the architecture defines different schemas stored at different levels for isolating the details one level from the other.
Different levels existing pat different levels of the database architecture pare expressed below with emphasis on the details of all the levels individually. Core of the database architecture is the internal level of schema which is discussed a bit before getting into the details of each level individually.
INTRODUCTION TO Database Management System (DBMS)Prof Ansari
shared collection of logically related data, designed to meet the information needs of multiple users in an organization. The term database is often erroneously referred to as a synonym for a “database management system DBMS)”. They are not equivalent and it will be explained in the next section.
Master thesis on Vehicular Ad hoc Networks (VANET)Prof Ansari
The increasing demand for wireless devices and wireless communication tends to research on self-organizing, self-healing networks without the interference of any pre-established or centralized infrastructure/authority [2]. The networks with the absence of any pre-established or centralized authority are known as Ad hoc networks [4]. Ad hoc Networks are the kind of wireless networks that uses multi-hop radio relay.There are many comparative studies and surveys that compare various ad hoc routing in VANET environment. The simulations performed in these comparative studies are very basic do not incorporate with a large number of nodes in real Vehicular Ad hoc Network environment. The main aim of our dissertation work is to firstly investigate the reactive and proactive routeing protocols than examine the performance of selected reactive routing protocols i.e. Destination Sequence Distance Vector Routing (DSDV), Ad hoc On-Demand Distance Vector (AODV), Optimized Link State Routing (OLSR) and Dynamic Source Routing (DSR)by taking three performance metrics like network load, throughput and end-to-end delay with varying number of mobile nodes or vehicle node densityOPNET: Optimized Network Engineering Tool (OPNET) is a commercial network simulator environment used for simulations of both wired and wireless networks [20]. Several different OPNET versions have been released over the last few years; the latest version of OPNET is the OPNET 16.0. At present OPNET is licensed under Riverbed technologies. It allows the user to design and study the network communication devices, protocols, individual applications and also simulate the performance of routing protocol. It supports many wireless technologies and standards such as, IEEE 802.11, IEEE 802.15.1, IEEE 802.16, IEEE 802.20 and satellite networks. OPNET IT Guru Academic Edition is available for free to the academic research and teaching community.
Master Thesis on Vehicular Ad-hoc Network (VANET)Prof Ansari
In present, many people during the public died each year in vehicle accidents, therefore in almost countries some safety data i.e. traffic lights & velocity limits are applied, simply however it is not a better solution. Also government and number of automation industries regarded that vehicular safety is real challenging task [1]. Then equally result, to enhance people traffic safety of a new progressed particular technology is formulated i.e. VANET [4]. It is progress type of MANET (Mobile Ad-hoc Network). VANET manages a network within which vehicles are act nodes and applied as mobile nodes to construct a robust infrastructure-less ad-hoc network. In Figure 1 illustrates the basic components of VANET architecture. It builds the network among Inter-Vehicle, Vehicle-to-Roadside and Inter-Roadside communicating networks [4]. Moreover, apart from accidental-safety and security types, there are also broad varieties of applications in VANET are available and potential that can extend passenger comfort like predictable mobility by GPS, web browsing and information modify and so on. Vehicular Ad-hoc Network (VANET) is a novel formulated form of Mobile Ad-hoc Network (MANET), where moving nodes are vehicles same automobiles, cars, buses etc [2].
Read/Write control logic:
The Read/Write Control logic interfaces the 8251A with CPU, determines the functions of the 8251A according to the control word written into its control register.
It monitors the data flow.
This section has three registers and they are control register, status register and data buffer.
The active low signals RD, WR, CS and C/D(Low) are used for read/write operations with these three registers.
When C/D(low) is high, the control register is selected for writing control word or reading status word.
HOST AND NETWORK SECURITY by ThesisScientist.comProf Ansari
Network management means different things to different people. In some cases, it involves a solitary network consultant monitoring network activity with an outdated protocol analyzer. In other cases, network management involves a distributed database, auto polling of network devices, and high-end workstations generating real-time graphical views of network topology changes and traffic. In general, network management is a service that employs a variety of tools, applications, and devices to assist human network managers in monitoring and maintaining networks.
SYSTEM NETWORK ADMINISTRATIONS GOALS and TIPSProf Ansari
The goal of network administration is to ensure that the users of networks receive the information and technically serves with the quality of services they expect.
Network administration means the management of network infrastructures devices (such as router and switches)
Network administration compromises of 3 majors groups:
1. Network provisioning
2. Network operations
3. Network maintenance
The VB6 IDE (Integrated Development Environment) is a very simple and fully featured IDE. If you start out programming in VB6 you may end up being too spoiled to ever appreciate a more complicated and less functional IDE like most C++ IDEs. One feature which sets VB6 apart from various IDEs is the simplicity of its approach to GUI (Graphical User Interface) design.
As a general rule: Play with it. You're very unlikely to break anything that matters, so just explore and experiment with the IDE, and you'll learn more.
ppt on blogging and In order to make money blogging you’re going to need to have a blog. While this is pretty obvious it is also a stumbling block for many PreBloggers who come to the idea of blogging with little or no technical background.blogging ppt presentation
Software Engineering is the set of processes and tools to develop software. Software Engineering is the combination of all the tools, techniques, and processes that used in software production. Therefore Software Engineering encompasses all those things that are used in software production like :
Programming Language
Programming Language Design
Software Design Techniques
Tools
Testing
Maintenance
Development etc.
These days object-oriented programming is widely being used. If programming languages will not support object-orientation then it will be very difficult to implement object-oriented design using object-oriented principles. All these efforts made the basis of software engineering.
E-Commerce is defined as the paperless exchange of business information using Electronic Data Interchange (EDI), electronic mail (e-mail), computer bulletin boards, Electronic Funds Transfer (EFT), and other, similar technologies.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
We have compiled the most important slides from each speaker's presentation. This year’s compilation, available for free, captures the key insights and contributions shared during the DfMAy 2024 conference.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Planning Of Procurement o different goods and services
Graph in Data Structure
1. For More Visit: Https://www.ThesisScientist.com
Unit 6
Graph
Definition and Terminology
A graph G consists of a non empty set V called the set of nodes (points, vertices) of the graph,
a set E, which is the set of edges of the graph and a mapping from the set of edges E to a pair
of elements of V.
Any two nodes, which are connected by an edge in a graph are called "adjacent nodes".
In a graph G(V,E) an edge which is directed from one node to another is called a "directed edge",
while an edge which has no specific direction is called an "undirected edge". A graph in which
every edge is directed is called a "directed graph" or a "digraph". A graph in which every edge is
undirected is called an "undirected graph".
If some of edges are directed and some are undirected in a graph then the graph is called a "mixed
graph".
Any graph which contains some parallel edges is called a "multigraph".
If there is no more than one edge but a pair of nodes then, such a graph is called "simple graph."
A graph in which weights are assigned to every edge is called a "weighted graph".
In a graph, a node which is not adjacent to any other node is called "isolated node".
A graph containing only isolated nodes is called a "null graph". In a directed graph for any node v
the number of edges which have v as initial node is called the "outdegree" of the node v. The
number of edges to have v as their terminal node is called the "Indegree" of v and Sum of
outdegree and indegree of a node v is called its total degree.
2. For More Visit: Https://www.ThesisScientist.com
l
V3
V1l
l l
l
l
V2
e1
e2
V4
V3
e3
V5
en
e6
e5
Simple
Out degree (V1) = 3
In degree (V1) = 0
l
l
l
l
Undirected
l l
l
l
Directed
ll
l l
l
l
V1
V2 V4
V5 V6 V7
V8l
V8 is isolated node
V1
V2
V3
V4
e4
l
l
ll
V8 and V4 have loops
V1
V2
V3
V7
l
l
ll
Weighted graph
l
l
l
V6
V5
V4
l
l
ll
l
Null graph
4
3
5
9
7
8
l
V3
V1l
l l
l
l
l
l l
l
l
V2
e1
e2
V4
V3
e3
V5
en
e6
e5
Simple
Out degree (V1) = 3
In degree (V1) = 0
l
l
l
l l
l
l
l
Undirected
l l
l
l
Directed
ll
l l
l
l
V1
V2 V4
V5 V6 V7
V8l
V8 is isolated node
V1
V2
V3
V4
e4
l
l
ll
V8 and V4 have loops
V1
V2
V3
V7
l
l
ll
Weighted graph
l
l
l
V6
V5
V4
l
l
ll
l
Null graph
4
3
5
9
7
8
Figure 6.1
3. For More Visit: Https://www.ThesisScientist.com
Definition and Terminology
A GRAPH G, consists of two sets V and E. V is a finite non-empty set of vertices. E is a set of pairs of
vertices, these pairs are called edges. V(G) and E(G) will represent the sets of vertices and edges of graph
G. In an undirected graph the pair of vertices representing any edge is unordered. Thus, the pair (V1 , V2)
and (V2, V1) represent the same edge.
In a directed graph each edge is represented by a directed pair <V1, V2>, V1 is the tail and V2 the head of
edge. Thus <V2, V1> and <V1, V2> represent two different edges.
Figure 6.2 : Three Sample Graph
The graph G1 and G2 are undirected. G3 is a directed graph.
l V(G1) = {1, 2, 3, 4,} ; E(G1) = {(1, 2), (1, 3), (1, 4), (2, 3), (2, 4) (3, 4)}
l V(G2) = {1, 2, 3, 4, 5, 6, 7} ; E(G2) = {(1, 2), (1, 3), (2, 4), (2, 5), (3, 6), (3, 7)}
l V(G3) = {1, 2, 3}; E(G3) = {<1, 2>, <2, 1>, <2, 3>}
The graph G1 is also a tree while the graphs G1 and G3 are not. A graph may not have multiple occurrences
of the same edge, when this restriction is removed from a graph, the resulting data object is referred to as a
multigraph, which is not a graph.
Figure 6.3 : Multigraph
.
4. For More Visit: Https://www.ThesisScientist.com
Representation of Graphs
Three most commonly used representations are :
i) Adjacency matrices
ii) Adjacency lists
iii) Adjacency multilist
Adjacency Matrix
Let G = (V, E) be a graph with n vertices, n 1. The adjacency matrix of (G) is a 2-dimensional nxn array,
say A, with the property that A(ij) = 1 if the edge (Vi, Vj) for a directed graph G is in E(G). The adjacency
matrix for an undirected graph is symmetric as the edge (Vi, Vj) is in E(G) if the edge (Vj, Vi) is also in
E(G).
The adjacency matrix for a directed graph need not be symmetric.
Figure 6.4 : Adjacency Matrix Representation of Graph
A simple digraph which doesn't have any cycle is called "acyclic". Naturally such graphs cannot have any
loop.
Example 1
Let, V ={v1,v2,v3}
vxv ={(v1v2), (v1v3), (v2v1),(v2v3), (v3v1),(v3v2),(v1v1),(v2v2), (v3v3)}
Suppose we have graph with 3 vertices: Consider the following graph with
set V :
v1 v2 v3
5. For More Visit: Https://www.ThesisScientist.com
v1 0 1 0
A = v2 0 0 0 Direction from Row to Column
v3 1 1 1
This matrix is also called "Adjacency matrix"
0 1 1
1 0 1
1 1 1
For a given digraph G (V,E) an Adjacency Matrix depends upon the ordering of the elements of V. For
different orderings of the elements of V we get different adjacency matrices of the same graph G.
Path Matrix
We can extend the idea of matrix representation to multigraph and weighted graphs. For simple undirected
graphs such an extension simply gives symmetric adjacency matrix. In the case of multigraph or a weighted
graph we write aij=wij, where wij denotes the weight of the edge (Vi,Vj). If (Vi, Vj)E then we write
wij =0
For a null graph, adjacency matrix is a null matrix. If there are loops at each node but no other edges in the
graph then the adjacncy matrix is the identity or unit matrix.
V1 V2 V3 V4
V1 0 1 0 1
Let us denote the elements of A2 by aij2 then A[i] = V2 1 0 0 0
V3 1 1 0 1
V4 0 1 0 0
aij(2)= nk=1aik,akj
for any fixed k aik.akj=1, if both aik and akj equals 1 i.e., (ViVk) (VkVj) are the edges of the graph.
The matrices A2, A3 and A4 for the graph represented by the above matrix are:
V1 V2 V3 V4 V1 V2 V3 V4
V1 1 1 0 0 V1 1 1 0 1
A2 = V2 0 1 0 1 A3= V2 0 1 0 1
V3 1 2 0 1 V3 2 2 0 1
V4 0 0 0 0 V4 1 1 0 0
V1 V2 V3 V4
V1 1 2 0 1
A4 = V2 1 1 0 1
6. For More Visit: Https://www.ThesisScientist.com
V3 2 3 0 2
V4 1 1 0 0
((1) (2) (3).... can be considered as the length of path)
The matrix representing the paths of length less than or equal to n which exists from Vi to Vj is
Bn = A+A2+......An
if we write dij = Vnr=1(aik bkj) V i, j = 1,2......n.
V = union of (OR)
= And
For example :
d11=(a11 b11) V(a12 b21) V ........(a1n Vbn1)
If for any k, the kth element in the row for A and the kth element in the column for B are both 1 then dij=1;
otherwise dij =0. Let us write AA =A(2), AA(x-1)=A(x) for any r=2,3........ the entry in the ith
row and jth
column of A(x) is 1 if there is at least one path of length r from Vi to Vj. The path matrix P is given by:
P=AVA(2)VA(3)V...VA(n)=Vnk=VnRs1A(k)
Warshall Algorithm
Given the adjacency matrix A , this matrix produces the path matrix P.
1. [Initialization]
PA
2 [Perform a pass]
Repeat three step A for k=1(1)n
3 [Process Rows]
Repeat step 4 for i=1(1) n.
4 [Across column]
Repeat for j=1(1)n
Pijpij V(Vik ^ Pkj)
5. [Exit]
Minimal Algorithm
Given the adjacency matrix B in which the zero elements are replaced by infinity or by some large number,
the matrix produced by the following algorithm shows the minimum length of paths between the nodes
MIN is a function that selects the algebraic minimum of its two arguments.
[1.] cB
[2.] Repeat thru step 4 for k =1(1) n
7. For More Visit: Https://www.ThesisScientist.com
[3.] Repeat thru step 4 forj =1(1) n
cij= MIN (cij, cik+ ckj)
[5.] exit
Example (Warshall)
Suppose we have 3 vertices v 1v2 v3
V1 V2 V3
Adjacency matrix A = V1 0 1 0
V2 0 0 0 = p
V3 1 1 1
V1 l
V3 V2
l l
V1 l
V3 V2
l l
I Iteration
R=1, i=1, j=1,2,3 for p(1)
P11=P11V(P11 P11) =0V(00)=0
P12=P12V(P11 P12) =1V(01)=1
P13=P13V(P11 P13) =0V(00)=0
k=1, i=2, j=1,2,3
P21=P21V(P21^P22)=0
P22=P22V(P21^ P22)=0
P23 =0
k=1, i=3, j=1,2,3
P31=P31 V (P31^P31)=1
P32=P32 V (P31^P32)=1
p33=P33 V (P31 ^ P33) = 1
Hence,
8. For More Visit: Https://www.ThesisScientist.com
0 1 0
Pv = 0 0 0
1 1 1
II Insertion
for k=2 for p(2)
i=1
j=1,2,3
P11=P11V(P12 ^ P21)=0
P12=P12V(P12 ^ P22)=0
P13=P13V(P12 ^ P23)=
. .
. .
. .
Similarly, we can calculate Matrix for
k=3 and so on
Adjacency List
In this representation the n rows of the adjacency matrix are represented as n linked lists. There is one list
for each vertex in G. The nodes in list i represent the vertices that are adjacent from vertex i.
Each node has two fields, VERTEX and LINK. The vertex field contains the indices of the vertices
adjacent to vertex i.
Each node has a head node. Head nodes are sequential providing easy random access to the adjacency list
for any particular vertex.
9. For More Visit: Https://www.ThesisScientist.com
Figure 6.5
Adjancency Multi-list
In the adjacency list representation of an undirect graph each edge (Vi, Vj) is represented by two
entries, one on the list for Vi and the other on the list for Vj. In some situations it is necessary to be
able to determine the second entry for a particular edge and mark that edge as already having been
examined. This can be accomplished easily if the adjacency lists are actually maintained as
multilist (i.e., lists in which nodes may be shared among several lists).
For each edge there will be exactly one node, but this node will be in two lists, i.e., the adjacency
list for each of the two nodes it is incident to. The node structure will be:
where M is a one bit mark field that may be used to indicate whether or not the edge has been
examined.
e.g., Graph
M V1 V2
LINK 1
For V1
LINK 2
For V2
10. For More Visit: Https://www.ThesisScientist.com
The lists are :
Vertex 1 : N1 N2 N3
Vertex 2 : N1 N4 N5
Vertex 3 : N2 N4 N6
Vertex 4 : N3 N5 N6
Figure 6.7 : Adjacency Multilist for the given Graph
Traversal of a Graph
l Depth first search
l Breadth first search
Depth First Search
DFS algorithm is analogous to preorder traversal of a tree. Given an undirected graph g= (V,E) and a vertex
V in V(G), we are interested in visiting all vertices in G that are reachable from (i.e. all vertices connected
to V).
11. For More Visit: Https://www.ThesisScientist.com
DFS of an undirected graph precedes as follows:
The start vertex C is visited Next an unvisited vertex w adjacent to V is selected and a depth first search
initiated. (Adjacent means connected by an Arc from the search node.)
Algorithm DFS (V)
1. Given an adjacent graph G=(V,E) with n vertices an array VISITED [N] initially set to zero
this algorithm visits all vertices reachable from V and visited are global.
VISITED (V) 1
2. Check for adjacent vertex W to V and call recursively
for each vertex W adjacent to V do
if (visited (W)=0) then call DFS(W)
end
3. [exit]
Breadh First Search
Starting at vertex V and making is as visited BFS differs from DFS in that all unvisited vertices
adjacent to V are visited next. Then unvisited vertices adjacent to these vertices are visited and so
on.
Algorithm BFS (V)
1. [A BFS of G is carried out beginning at vertex V. All vertices visited are marked as
VISTED(I)=1. The graph G and array VISITED are global and VISITED is initialized to 0]
VISITED (V) 1
initialize Q to be empty [Q is queue]
2. [Perform Iterations]
loop
for all vertices W adjacent to V do
if VISITED (W) =0
then [Add (W,Q); VISITED (W) 1]
end
if Q is empty then return;
DELETE (V,Q)
forever
12. For More Visit: Https://www.ThesisScientist.com
<exit>
GRAPH G
V1
V2 V3
V4 V7
V8
V5 V6
V1V1
V2V2 V3V3
V4V4 V7V7
V8V8
V5V5 V6V6
Traversing by DFS : V1, V2 , V4, V8, V5, V3, V6, V7
Traversing by BFS :V1, V2, V3, V4, V5, V6, V7, V8
Analysis of Algorithms
1. DFS
If G is represented by its adjacency matrix, then the time to determine all vertices adjacent to V is
O(N). Since at most n vertices are visited, the total time is O(N2
).
2. BFS
Each vertex visited gets into the queue exactly once, so the loop.....forever is iterated at most n
times.
If an adjacency matrix is used then the for loop takes O(N) times for each vertex visited.
The total time is therefore O(N2
).
Weighted Graphs
A graph in which weights are assigned to every edge is called a Weighted graph.
Shortest Path in Weighted Graphs
Let G= (v,e,w) be a weighted graph where w is weight (in terms of time or cost) assigned to that
edge.
The length of a path in G is defined as the sum of lengths of the edges in the path.
Dijkstra's Shortest Path Algorithm
13. For More Visit: Https://www.ThesisScientist.com
Let TV with AT (A= starting node). Let P be the subset of vertices V-T, let L(T) denote the
length of a shortest path among all paths from A to T that does not include any other vertex in T.
We call L(T) the index of T with respect to P.
Let X be a vertex in T. Let P' be PU{X} and T' be T-{X}. Let L'(T) denote the index of a
vertex T inT' with respect to P'. We claim that
L'(T) =Min[L(T), L(X), L(W,T)]-----------(i)
Algorithm
1. Initially let P= [a] and T =V-[a] , for every vertex t in t, let l(t)= w (A,t).
2. Select the vertex in T that has the smallest index with respect to P, let it denote it vertex x.
3. If x is the vertex we wish to reach from A stop. If not let P'=PU{x} and T=T-{x}. For
every vertex t in T compute its index with respect to P' according to 1.
4. Repeat steps 2 and 3 using P' as P and T' as T.
5. Stop.
Example
Find the shortest path from A to Z for the given graph:
1.
B D
C E
A Z
1
2
4
7
5
1
2
3
6
BB DD
CC EE
AA ZZ
1
2
4
7
5
1
2
3
6
Solution:
Initially P={A} and
T={B,C,E,D,Z}
The lengths of different vertices (with respect to P) are :
L(B)=1 , L(C)=4, L(D)=L(E)= L(Z)=
l so L(B)= 1 is the shortest value
Now let P={A,B} and T={C,D,E,Z}
14. For More Visit: Https://www.ThesisScientist.com
so, L(C)=3, L(D)=8, L(E)=6, L(Z)=
l So L(C) =3, is the shortest value.
Now P={A,B, C} and T'={D,E,Z}
L'(D)= Min{8,}=8. L'(E)= Min{6,3+1}=4
L'(Z) = Min {,3+}=
Successive observations are shown in following figures:
Thus the shortest path from A to Z is (A, B, C, E, D, Z) of length 9.
B D
C E
A Z
DD
ZZ
2.
4 (a)
B D
C E
A Z
DD
ZZ
2.
4 (a)
15. For More Visit: Https://www.ThesisScientist.com
Spanning Trees
It is a tree obtained from a Graph, which covers all its vertices.
Minimal Spanning Tree
It is a tree from the set of spanning trees, which has minimum weight.
There are two methods to find minimum spanning tree.
l Prim's Method
l Kruskal's method
1. Prim's Method
Draw n isolated vertices and label them as V1,V2.....Vn. Tabulate the given weights of the
edges of G in an nxn table. Set the weights of the non-existing edges as very large ()
l
l
ll
l
l
17
8
11
V4
10V5
16
V1
V2
V6
V3
9
7
7
19.5
9.512
l
l
ll
l
l
17
8
11
V4
10V5
16
V1
V2
V6
V3
9
7
7
19.5
9.512
V V2 V3 V4 V5 V6
V1 - 10 16 11 10 17
V2 10 - 9.5 19.5
V3 16 9.5 - 7 12
V4 11 7 - 8 7
V5 10 8 - 9
V6 17 19.5 12 7 9 -
16. For More Visit: Https://www.ThesisScientist.com
Start from vertex V1 and connect it to its nearest neighbor say Vk. Now consider V1 and Vk as one subgraph
and connect this subgraph to its closest neighbor (i.e. to a vertex other than V1 and Vk that has the smallest
entry among all entries in rows 1 and k.)
2. Kruskal's Method
In this approach Minimum cost spanning tree T is built edge by edge. Edges are considered for
inclusion in T in ascending order. An edge is included in T if it doesn't form a cycle with edges
already in T. Since G is connected and has n>0 vertices exactly (n-1) edges will be selected for
inclusion in T.
1
5
6
2
4
3
16
21 11
33 14
18
19 6
5
10
11
55
66
22
44
33
16
21 11
33 14
18
19 6
5
10
Edge Cost Action Resulting Tree
.... ...... ......... .......................
(2,3) 5 Accept
(2,4) 6 Accept
(3,4) 10 Reject "
(2,6) 11 Accept
(4,6) 14 Reject "
(1,2) 16 Accept
(4,5) 18 Accept
1 2 3 4 5 6
1 3 4 5 62
1 3 5 62
4
11 22 33 44 55 66
11 33 44 55 6622
11 33 55 6622
44
1 5
43 6
211 55
4433 66
22
5
43 6
21 55
4433 66
2211
43 6
21
5
4433 66
2211
55