11 views

Original Title: Assignment 2

Uploaded by PunithRossi

- Graph Coloring
- ECE242.Fall11
- MCS Notes v1.2
- Data Interpretation & Sufficiency by Haripal Rawat
- F-64 (1)
- Domination Number on Balanced Signed Graphs
- matrix borgatti.pdf
- semester one reports vit
- New Report
- Network Literacy Low Res
- Contents
- PrintPlayPencilNPaper12
- R Gemmell R Thomas the Measured Mile How to Conduct the Analysis Thomson Reuters 032 BCL 01
- Informed Search 1
- lec not
- Trigonometry Formulae
- 1304.2215v1
- De Brujin sequence.pdf
- dual.PDF
- www6

You are on page 1of 6

1) Write a program for finding maximum bipartite sub-graph in a given graph. Explain

your approach with suitable test cases?

2) Write a program for solving Chinese postman problem. Explain your approach with

suitable test cases?

3) Write a Prolog code for finding all kings of a tournament. Explain your approach

with suitable test cases?

4) Write a program for finding maximum matching in a given bipartite graph. Explain

your approach with suitable test cases?

5) Write a program to generate Prufer code for a given labelled tree. Explain your

approach with suitable test cases?

Solutions

1. The vertex with the maximum degree is found out and added to the x-partite. All the

vertices adjacent to this vertex are added to the y-partite. The next vertex with the

highest degree is found out, and if it is not present in any partite, it is added to the x-

partite and all the vertices adjacent to this vertex are added to the y-partite. If that

vertex is already present in the y-partite, then the vertex with the maximum degree

adjacent to this vertex and also not present in any partite is found out and added to x-

partite and all the vertices adjacent to this vertex are added to the y-partite. This

procedure is repeated till all the vertices are covered.

The graph used for testing:

The output:

2. The Chinese Postman problem involves finding an Eulerian path. If there exists an

Eulerian path, then the shortest path to be covered by the postman is just the sum of

all lengths of edges. Else, the odd degree vertices have to be paired in such a way that

the path length is minimised. Since more than 4 odd degree vertices may result in at

least 15 different ways of pairing, this algorithm runs only on graphs with at most 4

odd degree vertices.

The graph used for testing:

Here, A and H have to be paired, and the shortest path between them is ABFH.

The output:

3. A king of a tournament is an element which can connect to all other elements

through at most two edges. The same logic is applied in the code.

The graph used is:

A -> B || A -> D || A -> D -> C

C -> A || C -> B ||C -> B/A -> D

D -> C -> A || D -> C -> B || D -> C

The output:

4. Maximum matching of a bipartite graph can be used by network flow. A dummy

source and sink is created and the source is connected to all the elements in the x-

partite and all the elements in the y-partite are connected to the sink and the

capacities of all the edges are taken to be 1. Applying Ford-Fulkersons algorithm to

solve network flow, we can find the maximum matching of the graph.

The graph used for testing:

The output:

5. The Prufer Code algorithm is applied. The leaf nodes are found, eliminated and the

adjacent node is printed till there is only one edge present.

The graph used for testing is:

- Graph ColoringUploaded bySrikar Chintala
- ECE242.Fall11Uploaded byJoe Reis
- MCS Notes v1.2Uploaded byDesmond Yap Weei Kee
- Data Interpretation & Sufficiency by Haripal RawatUploaded byPayal Chauhan
- F-64 (1)Uploaded byLightness Aron
- Domination Number on Balanced Signed GraphsUploaded byIntegrated Intelligent Research
- matrix borgatti.pdfUploaded byShinji Ikari
- semester one reports vitUploaded byapi-336022570
- New ReportUploaded bygshashidhar125
- Network Literacy Low ResUploaded byValentina Carranza Weihmüller
- ContentsUploaded byHimanshu Agarwal
- PrintPlayPencilNPaper12Uploaded bybbscribed
- R Gemmell R Thomas the Measured Mile How to Conduct the Analysis Thomson Reuters 032 BCL 01Uploaded bylee
- Informed Search 1Uploaded bytalhaaftab728
- lec notUploaded bystacy
- Trigonometry FormulaeUploaded bySunil Singh
- 1304.2215v1Uploaded byAbdul Qadir
- De Brujin sequence.pdfUploaded byxenulhassan
- dual.PDFUploaded bydangreglong
- www6Uploaded bypostscript
- Kretschmer Kundra DeB Beaver Kretschmer10.1007 s11192 012 0661 51Uploaded byChinmoyGhosh
- 003maddurik2Uploaded byhectorjazz
- Intelligence and Security InformaticsUploaded byAdam Whitesnow
- Homework 2 - Math 53Uploaded byArlan Rodrigo
- High Dimensional Data Clustering Based On Feature Selection AlgorithmUploaded byijcert
- Informe Final CarbonUploaded byjuan 26
- 2 Inverse TrigoUploaded byRajesh Sarswat
- m3-search(1)Uploaded byapi-3705912
- Copy of 2010 Era Journal Rank ListUploaded byFahad Zia
- optimization techiniquesUploaded byMuhammad Ali Khan Awan

- CacheUploaded byPunithRossi
- CacheUploaded byPunithRossi
- Consul Book PerspUploaded byAmrendra0202
- Greening GrowthUploaded byvanhung2809
- ResumeIITBomayUploaded byPunithRossi
- 5.Risk and ReturnUploaded byPunithRossi
- transport_1532460483.pdfUploaded byPunithRossi
- transport_1532460483.pdfUploaded byPunithRossi
- Chapter 2Uploaded bynajmul
- Chapter 2Uploaded bynajmul
- EPIndexreport of Yaleunvereisty2012Uploaded byPunithRossi
- FLAT2Uploaded byPunithRossi
- Mannipaya LyricsUploaded byPunithRossi
- Larry EllyUploaded byPunithRossi
- mitacs_globalink_reference_letter_instructions_june2016.pdfUploaded bypreetesh
- Business Planning ProcessUploaded byPunithRossi
- Classtest Solutions TSMUploaded byPunithRossi
- Algorithms 1Uploaded byPunithRossi
- Signals and Systems- Assignment 01_Signal Representations_ - CopyUploaded byVIVEK
- Digital CountersUploaded byPunithRossi
- RAM StatementsUploaded byPunithRossi
- FLAT CurriculumUploaded byPunithRossi
- wienbrUploaded byahimpli
- RAMP GENERATORS.pdfUploaded byPunithRossi
- Eurozone CrisisUploaded byPunithRossi
- IEUploaded byPunithRossi
- Theory of ComputationUploaded byVikas Maurya
- Transducer , Sensors and Measurement (EE2L002) Assignment 3Uploaded byPunithRossi
- flip-flopUploaded byKulwant Nagi

- CSC Lab 5Uploaded byChris Lee
- conceptofcdatatypes-090925045031-phpapp02Uploaded byJithendra Babu
- CodesUploaded byAnkita Aggarwal
- Computational Complexity TheoryUploaded byslowdog
- Artificial Intelligence - Unification TheoryUploaded byBryan Wallin
- Theory of Automata - IntroductionUploaded byjustin jazz
- Cp7102 Advanced Datastructure and AlgorithmUploaded bypushpa
- logicbUploaded byAbin Chua Hong Yean
- State Design Gray CodeUploaded byjeyanthvr
- asfasfUploaded byThiago Araujo
- DEVRY CIS 115 Final Exam 3.docUploaded byhenrycrawl
- Pattern_Matching_Algorithms.pdfUploaded byMarcus Braga
- 901470 Prolog PresUploaded byJyoti Rajput Pawar
- Data Structures and the Java Collections Framework, 3rd Edition.pdfUploaded byRithuik Yerrabrolu
- D&C1Uploaded byvkry007
- Topo SortUploaded bysankar_mca227390
- Diffusing CompUploaded byRizwan Ayub
- Rr310504 Theory of ComputationUploaded bySrinivasa Rao G
- RecursionUploaded byMilind Shah
- EssayUploaded bydatcat
- Rule Based ClassificationUploaded byDeepesh
- Ms Primitive RecursiveUploaded bymansha99
- High-Precision Abscissae and Weights of Gaussian QuadratureUploaded byRMolina65
- o2 Programming LanguageUploaded bymuimuimui1
- Lecture 15 h.stack-queueUploaded byjnfz
- LinearProgramming.docUploaded byMiluska Jara Pinto
- 302 Computer Oriented Numerical MethodsUploaded byRaja Bora
- 08 r05310505 Principles of Programming LangaugesUploaded byandhracolleges
- Week4 Quiz FeedbackUploaded bymehtav23
- 18034592 Test Your C Skills With AnswersUploaded byRamJiDR