SlideShare a Scribd company logo
1 of 11
by
G.GowriLatha,M.Sc (Info Tech),
Department of CS&IT
Nadar Saraswathi college of arts and
science, Theni
Path and application of
set
Data structure
1.Path Compression:
 Using unthreaded tress, Find takes logarithmic time
and everything else is constant;
 Threaded trees, Union takes logarithmic amortized
time and everything else is constant.
 A third method allows us to get both of these
operations to have almost constant running time.
 We start with the original unthreaded tree
representation, where every object points to a parent.
 The key observation is that in any Find operation,
once we determine the leader of an object x, we can
speed up future Finds by redirecting x ’ s parent
pointer directly to that leader.
The effect of path compression after find(7) on the
above worst-case tree .
Worst –case tree for N=8
1
2
5
3
4
6
7
8
ROUTINE FOR DISJOINT SET FIND WITH PATH
COMPRESSION:
Set Type Find(Element type X , Disjoint S)
{
If(S[X]<=0)
return x:
else
return S[X]=Find(S[X],S)
}
Path compression is a trivial change to the basic find
algorithm. The only change to the find routine is that S[X]
is made equal to the value returned by find , thus after the
root of the set is found recursively , X is made to point
directly to it.
•s It has been proven that when path compression is
done , a sequence of M operations required at most
O(M log N) time.
• path compression is perfectly compatible with union
by size. It executes a sequence of M operations in line
time.
•Path compression is not entirely compatible with
union-by size. It executes a sequence of M operations
in line time.
•Path compression is not entirely compatible with
union-by-height , because path compression can
change the heights of the trees.
APPLICATION OF SET
 Many mathematical concepts can be defined
precisely using only set theoretic concepts. For
example, mathematical structures as diverse
as graphs, manifolds, rings, and vector spaces
can all be defined as sets satisfying various
(axiomatic) properties.
Equivalence and order relations are ubiquitous
in mathematics, and the theory of
mathematical relations can be described in set
theory.
Set theory is also a promising foundational system
for much of mathematics. Since the publication of
the first volume of Principia Mathematical,
 It has been claimed that most or even all
mathematical theorems can be derived using an
aptly designed set of axioms for set theory,
augmented with many definitions, using first
or second order logic.
For example, properties of the natural and real
numbers can be derived within set theory, as each
number system can be identified with a set
of equivalence classes under a suitable equivalence
relation whose field is some infinite set.
Set theory as a foundation for mathematical
analysis, topology, abstract algebra, and discrete
mathematics is likewise uncontroversial;
mathematicians accept that (in principle)
theorems in these areas can be derived from the
relevant definitions and the axioms of set theory.
 Few full derivations of complex mathematical
theorems from set theory have been formally
verified, however, because such formal derivations
are often much longer than the natural language
proofs mathematicians commonly present. c
One verification project, Met math, includes
human-written, computer‐verified derivations of
more than 12,000 theorems starting from ZFC set
theory, first order logic and propositional logic.
An algorithms to transfer file from any computer
on the network to any other In on-line uses set
concept. The following steps are performed to do
this task,
Initially put every computer in its own test.
our invariant is that two computers
can transfer files is an only is they are
in the same set.
 the ability to transfer files forms an
equivalence relation.
 then connections are read one at a
time say(u , v) and it is tested to see
whether u and v are in the same set
or in different sets.
 if they are in the same set, nothing is done else
merge there sets.
 At the end of the algorithm, the graph is
connected is and only if there is exactly one set.
If there are M connections and N computers, the
space requirements is O(N). Using union-by-size
and path compression , worst-case running time
of O(M &(M,N)) is obtained.
10 10 55 10 10
5
W RE

More Related Content

What's hot

A taxonomy of suffix array construction algorithms
A taxonomy of suffix array construction algorithmsA taxonomy of suffix array construction algorithms
A taxonomy of suffix array construction algorithms
unyil96
 
Physics student presentation jan 2010 artifact gall
Physics student presentation jan 2010 artifact gallPhysics student presentation jan 2010 artifact gall
Physics student presentation jan 2010 artifact gall
Mad Science of Detroit
 
CLIQUE Automatic subspace clustering of high dimensional data for data mining...
CLIQUE Automatic subspace clustering of high dimensional data for data mining...CLIQUE Automatic subspace clustering of high dimensional data for data mining...
CLIQUE Automatic subspace clustering of high dimensional data for data mining...
Raed Aldahdooh
 
Combining text and pattern preprocessing in an adaptive dna pattern matcher
Combining text and pattern preprocessing in an adaptive dna pattern matcherCombining text and pattern preprocessing in an adaptive dna pattern matcher
Combining text and pattern preprocessing in an adaptive dna pattern matcher
IAEME Publication
 
RFNM-Aranda-Final.PDF
RFNM-Aranda-Final.PDFRFNM-Aranda-Final.PDF
RFNM-Aranda-Final.PDF
Thomas Aranda
 
István Dienes Lecture For Unified Theories 2006
István Dienes Lecture For Unified Theories 2006István Dienes Lecture For Unified Theories 2006
István Dienes Lecture For Unified Theories 2006
Istvan Dienes
 

What's hot (17)

Dbscan
DbscanDbscan
Dbscan
 
Advanced topics in artificial neural networks
Advanced topics in artificial neural networksAdvanced topics in artificial neural networks
Advanced topics in artificial neural networks
 
Improved k-means
Improved k-meansImproved k-means
Improved k-means
 
A NEW PARALLEL ALGORITHM FOR COMPUTING MINIMUM SPANNING TREE
A NEW PARALLEL ALGORITHM FOR COMPUTING MINIMUM SPANNING TREEA NEW PARALLEL ALGORITHM FOR COMPUTING MINIMUM SPANNING TREE
A NEW PARALLEL ALGORITHM FOR COMPUTING MINIMUM SPANNING TREE
 
A taxonomy of suffix array construction algorithms
A taxonomy of suffix array construction algorithmsA taxonomy of suffix array construction algorithms
A taxonomy of suffix array construction algorithms
 
Physics student presentation jan 2010 artifact gall
Physics student presentation jan 2010 artifact gallPhysics student presentation jan 2010 artifact gall
Physics student presentation jan 2010 artifact gall
 
Poster
PosterPoster
Poster
 
Asonam 2019-zvi-3-s
Asonam 2019-zvi-3-sAsonam 2019-zvi-3-s
Asonam 2019-zvi-3-s
 
CLIQUE Automatic subspace clustering of high dimensional data for data mining...
CLIQUE Automatic subspace clustering of high dimensional data for data mining...CLIQUE Automatic subspace clustering of high dimensional data for data mining...
CLIQUE Automatic subspace clustering of high dimensional data for data mining...
 
maths project
maths projectmaths project
maths project
 
Gaussian processes
Gaussian processesGaussian processes
Gaussian processes
 
Minimality and Equicontinuity of a Sequence of Maps in Iterative Way
Minimality and Equicontinuity of a Sequence of Maps in Iterative WayMinimality and Equicontinuity of a Sequence of Maps in Iterative Way
Minimality and Equicontinuity of a Sequence of Maps in Iterative Way
 
Tie set and tie-set matrix
Tie set and tie-set matrixTie set and tie-set matrix
Tie set and tie-set matrix
 
Combining text and pattern preprocessing in an adaptive dna pattern matcher
Combining text and pattern preprocessing in an adaptive dna pattern matcherCombining text and pattern preprocessing in an adaptive dna pattern matcher
Combining text and pattern preprocessing in an adaptive dna pattern matcher
 
RFNM-Aranda-Final.PDF
RFNM-Aranda-Final.PDFRFNM-Aranda-Final.PDF
RFNM-Aranda-Final.PDF
 
Affine array index
Affine array indexAffine array index
Affine array index
 
István Dienes Lecture For Unified Theories 2006
István Dienes Lecture For Unified Theories 2006István Dienes Lecture For Unified Theories 2006
István Dienes Lecture For Unified Theories 2006
 

Similar to Path &amp; application(ds)2

8.clustering algorithm.k means.em algorithm
8.clustering algorithm.k means.em algorithm8.clustering algorithm.k means.em algorithm
8.clustering algorithm.k means.em algorithm
Laura Petrosanu
 
International Journal of Computer Science and Security Volume (2) Issue (5)
International Journal of Computer Science and Security Volume (2) Issue (5)International Journal of Computer Science and Security Volume (2) Issue (5)
International Journal of Computer Science and Security Volume (2) Issue (5)
CSCJournals
 

Similar to Path &amp; application(ds)2 (20)

Discovering Novel Information with sentence Level clustering From Multi-docu...
Discovering Novel Information with sentence Level clustering  From Multi-docu...Discovering Novel Information with sentence Level clustering  From Multi-docu...
Discovering Novel Information with sentence Level clustering From Multi-docu...
 
nonlinear_rmt.pdf
nonlinear_rmt.pdfnonlinear_rmt.pdf
nonlinear_rmt.pdf
 
Planted Clique Research Paper
Planted Clique Research PaperPlanted Clique Research Paper
Planted Clique Research Paper
 
paper
paperpaper
paper
 
graph_embeddings
graph_embeddingsgraph_embeddings
graph_embeddings
 
Neural Model-Applying Network (Neuman): A New Basis for Computational Cognition
Neural Model-Applying Network (Neuman): A New Basis for Computational CognitionNeural Model-Applying Network (Neuman): A New Basis for Computational Cognition
Neural Model-Applying Network (Neuman): A New Basis for Computational Cognition
 
8.clustering algorithm.k means.em algorithm
8.clustering algorithm.k means.em algorithm8.clustering algorithm.k means.em algorithm
8.clustering algorithm.k means.em algorithm
 
Compressing the dependent elements of multiset
Compressing the dependent elements of multisetCompressing the dependent elements of multiset
Compressing the dependent elements of multiset
 
NEURAL MODEL-APPLYING NETWORK (NEUMAN): A NEW BASIS FOR COMPUTATIONAL COGNITION
NEURAL MODEL-APPLYING NETWORK (NEUMAN): A NEW BASIS FOR COMPUTATIONAL COGNITIONNEURAL MODEL-APPLYING NETWORK (NEUMAN): A NEW BASIS FOR COMPUTATIONAL COGNITION
NEURAL MODEL-APPLYING NETWORK (NEUMAN): A NEW BASIS FOR COMPUTATIONAL COGNITION
 
International Journal of Computer Science and Security Volume (2) Issue (5)
International Journal of Computer Science and Security Volume (2) Issue (5)International Journal of Computer Science and Security Volume (2) Issue (5)
International Journal of Computer Science and Security Volume (2) Issue (5)
 
Accelerating materials property predictions using machine learning
Accelerating materials property predictions using machine learningAccelerating materials property predictions using machine learning
Accelerating materials property predictions using machine learning
 
Mathematical Model of Affinity Predictive Model for Multi-Class Prediction
Mathematical Model of Affinity Predictive Model for Multi-Class PredictionMathematical Model of Affinity Predictive Model for Multi-Class Prediction
Mathematical Model of Affinity Predictive Model for Multi-Class Prediction
 
Fuzzy set
Fuzzy set Fuzzy set
Fuzzy set
 
Nonequilibrium Network Dynamics_Inference, Fluctuation-Respones & Tipping Poi...
Nonequilibrium Network Dynamics_Inference, Fluctuation-Respones & Tipping Poi...Nonequilibrium Network Dynamics_Inference, Fluctuation-Respones & Tipping Poi...
Nonequilibrium Network Dynamics_Inference, Fluctuation-Respones & Tipping Poi...
 
Hierarchical topics in texts generated by a stream
Hierarchical topics in texts generated by a streamHierarchical topics in texts generated by a stream
Hierarchical topics in texts generated by a stream
 
Hierarchical topics in texts generated by a stream
Hierarchical topics in texts generated by a streamHierarchical topics in texts generated by a stream
Hierarchical topics in texts generated by a stream
 
240401_JW_labseminar[LINE: Large-scale Information Network Embeddin].pptx
240401_JW_labseminar[LINE: Large-scale Information Network Embeddin].pptx240401_JW_labseminar[LINE: Large-scale Information Network Embeddin].pptx
240401_JW_labseminar[LINE: Large-scale Information Network Embeddin].pptx
 
Applied Mathematics and Sciences: An International Journal (MathSJ)
Applied Mathematics and Sciences: An International Journal (MathSJ)Applied Mathematics and Sciences: An International Journal (MathSJ)
Applied Mathematics and Sciences: An International Journal (MathSJ)
 
Linear algebra havard university
Linear algebra havard universityLinear algebra havard university
Linear algebra havard university
 
Combination of Similarity Measures for Time Series Classification using Genet...
Combination of Similarity Measures for Time Series Classification using Genet...Combination of Similarity Measures for Time Series Classification using Genet...
Combination of Similarity Measures for Time Series Classification using Genet...
 

More from GowriLatha1 (20)

Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domain
 
Demand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessDemand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple access
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Shadow paging
Shadow pagingShadow paging
Shadow paging
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Hive
HiveHive
Hive
 
Web services & com+ components
Web services & com+ componentsWeb services & com+ components
Web services & com+ components
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databases
 
Recovery system
Recovery systemRecovery system
Recovery system
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databases
 
Static analysis
Static analysisStatic analysis
Static analysis
 
Hema dm
Hema dmHema dm
Hema dm
 
Data reduction
Data reductionData reduction
Data reduction
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
computer network
computer networkcomputer network
computer network
 
Operating System
Operating SystemOperating System
Operating System
 
Data mining query language
Data mining query languageData mining query language
Data mining query language
 
Enterprice java
Enterprice javaEnterprice java
Enterprice java
 
Ethernet
EthernetEthernet
Ethernet
 
Java script
Java scriptJava script
Java script
 

Recently uploaded

Recently uploaded (20)

Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 

Path &amp; application(ds)2

  • 1. by G.GowriLatha,M.Sc (Info Tech), Department of CS&IT Nadar Saraswathi college of arts and science, Theni Path and application of set
  • 2. Data structure 1.Path Compression:  Using unthreaded tress, Find takes logarithmic time and everything else is constant;  Threaded trees, Union takes logarithmic amortized time and everything else is constant.  A third method allows us to get both of these operations to have almost constant running time.  We start with the original unthreaded tree representation, where every object points to a parent.
  • 3.  The key observation is that in any Find operation, once we determine the leader of an object x, we can speed up future Finds by redirecting x ’ s parent pointer directly to that leader. The effect of path compression after find(7) on the above worst-case tree . Worst –case tree for N=8 1 2 5 3 4 6 7 8
  • 4. ROUTINE FOR DISJOINT SET FIND WITH PATH COMPRESSION: Set Type Find(Element type X , Disjoint S) { If(S[X]<=0) return x: else return S[X]=Find(S[X],S) } Path compression is a trivial change to the basic find algorithm. The only change to the find routine is that S[X] is made equal to the value returned by find , thus after the root of the set is found recursively , X is made to point directly to it.
  • 5. •s It has been proven that when path compression is done , a sequence of M operations required at most O(M log N) time. • path compression is perfectly compatible with union by size. It executes a sequence of M operations in line time. •Path compression is not entirely compatible with union-by size. It executes a sequence of M operations in line time. •Path compression is not entirely compatible with union-by-height , because path compression can change the heights of the trees.
  • 6. APPLICATION OF SET  Many mathematical concepts can be defined precisely using only set theoretic concepts. For example, mathematical structures as diverse as graphs, manifolds, rings, and vector spaces can all be defined as sets satisfying various (axiomatic) properties. Equivalence and order relations are ubiquitous in mathematics, and the theory of mathematical relations can be described in set theory.
  • 7. Set theory is also a promising foundational system for much of mathematics. Since the publication of the first volume of Principia Mathematical,  It has been claimed that most or even all mathematical theorems can be derived using an aptly designed set of axioms for set theory, augmented with many definitions, using first or second order logic. For example, properties of the natural and real numbers can be derived within set theory, as each number system can be identified with a set of equivalence classes under a suitable equivalence relation whose field is some infinite set.
  • 8. Set theory as a foundation for mathematical analysis, topology, abstract algebra, and discrete mathematics is likewise uncontroversial; mathematicians accept that (in principle) theorems in these areas can be derived from the relevant definitions and the axioms of set theory.  Few full derivations of complex mathematical theorems from set theory have been formally verified, however, because such formal derivations are often much longer than the natural language proofs mathematicians commonly present. c
  • 9. One verification project, Met math, includes human-written, computer‐verified derivations of more than 12,000 theorems starting from ZFC set theory, first order logic and propositional logic. An algorithms to transfer file from any computer on the network to any other In on-line uses set concept. The following steps are performed to do this task, Initially put every computer in its own test.
  • 10. our invariant is that two computers can transfer files is an only is they are in the same set.  the ability to transfer files forms an equivalence relation.  then connections are read one at a time say(u , v) and it is tested to see whether u and v are in the same set or in different sets.
  • 11.  if they are in the same set, nothing is done else merge there sets.  At the end of the algorithm, the graph is connected is and only if there is exactly one set. If there are M connections and N computers, the space requirements is O(N). Using union-by-size and path compression , worst-case running time of O(M &(M,N)) is obtained. 10 10 55 10 10 5 W RE