a

© All Rights Reserved

26 views

a

© All Rights Reserved

- Efficient Region Search for Object Detection - Vijayanarasimhan Grauman - Proceedings of IEEE Conference on Computer Vision and Pattern Recognition - 2011
- Graphs Lect7
- lecture 10 introduction to algebraic graph theory
- Dijkstra's Algorithm on Line - An Empirical Case Study From Public Railroad Transport
- Scheduling in Sport & Entertainments
- ROS Transforms
- IJCAI09-184
- Brute Force
- A Spectral Approach to Bandwidth
- EMBEDDED NETWORKING UNIT 5
- pgcs2012.pdf
- n10-mincostflow
- NCPD
- 10.1.1.85.7672
- Lecture8- Transportataion-SPP.ppsx
- Elementry Graph Algorithm
- 2012_A Discrete Event Model for Real Time System Simulation
- R Tutorial
- lecture3-casfasegment2
- SocialMediaLab Package Tutorial

You are on page 1of 18

Algorithmic Thinking

Luay Nakhleh

Department of Computer Science

Rice University

problem definition.

produces algorithms that are prohibitively slow.

Bipartite Graphs

two disjoint and non-empty sets V1 and V2 such that every edge in the

graph connects a node in V1 and a node in V2. When this condition

holds, we call the pair (V1,V2) a bipartition of the node set V of G.

A Brute Force Algorithm

Algorithms Demo

Algorithm 1: IsBipartite.

Input: Undirected graph g = (V, E).

Output: True if g is bipartite, and False otherwise.

1 foreach Non-empty subset V1 V do

2

V2

V \ V1 ;

3

bipartite

T rue;

4

foreach Edge {u, v} 2 E do

5

if {u, v} V1 or {u, v} V2 then

6

bipartite

F alse;

7

Break;

8

9

10

return True;

return False;

4

Graph Connectivity:

Paths

e1,e2,...,ek of G such that e1={v0,v1}, e2={v1,v2}, ..., ek={vk-1,vk}, where v0,...,vk are all

nodes in V, and e1,...,ek are all edges in E.

A path is simple if it does not contain the same node more than once.

A cycle is a simple path that begins and ends at the same node.

A path (not necessarily simple) that begins and ends at the same node is called a

circuit.

5

A Brute Force Algorithm

COMP 182: Algorithmic Thinking

Algorithm 2: IsConnected.

Input: Undirected graph g = (V, E), |V | 2, and two nodes u, v 2 V , such that u 6= v.

Output: T rue if there is a path between u and v in g, and F alse otherwise.

1

2

3

4

5

6

7

8

9

10

11

12

13

N odes

V {u, v};

for c

0 to |N odes| do

x0

u;

xc+1

v;

foreach subset W N odes of size c do

foreach permutation x1 , . . . , xc of the elements of W do

Connected

T rue;

for i

0 to c do

if {xi , xi+1 } 2

/ E then

Connected

F alse;

Break;

if Connected = T rue then

return True;

return False;

6

path between i and j is a path P that connects the two nodes and every

other path that connects i and j is either longer than P or of equal

length.

between them.

algorithm for finding

subgraph of size k?

cycle that visits all nodes of G exactly once.

10

alphabet that has at least two letters.

are between 1 and n, and xi1xi2...xiM=yi1yi2...yiM.

11

x1

x2

x3

x4

y1

y2

ab

bbaaba

bb

y3

y4

bbbb ab

12

x1

x2

x3

x4

y1

y2

ab

bbaaba

bb

y3

y4

bbbb ab

(to verify: check that x1x3x2x4x4x3=y1y3y2y4y4y3)

12

x1

x2

x3

x4

y1

y2

ab

bbaaba

bb

y3

y4

bbbb ab

(to verify: check that x1x3x2x4x4x3=y1y3y2y4y4y3)

x1

x2

y1

y2

ab

ba

12

x1

x2

x3

x4

y1

y2

ab

bbaaba

bb

y3

y4

bbbb ab

(to verify: check that x1x3x2x4x4x3=y1y3y2y4y4y3)

x1

x2

y1

y2

ab

ba

No Solution!

12

13

14

15

- Efficient Region Search for Object Detection - Vijayanarasimhan Grauman - Proceedings of IEEE Conference on Computer Vision and Pattern Recognition - 2011Uploaded byzukun
- Graphs Lect7Uploaded bypurijatin
- lecture 10 introduction to algebraic graph theoryUploaded bykientrungle2001
- Dijkstra's Algorithm on Line - An Empirical Case Study From Public Railroad TransportUploaded byPrima Hernandia
- Scheduling in Sport & EntertainmentsUploaded byforjoe45
- ROS TransformsUploaded byPablo Freeman
- IJCAI09-184Uploaded byNikhil Ketkar
- Brute ForceUploaded byWaqar Hussain
- A Spectral Approach to BandwidthUploaded byforoud_makvandi1985
- EMBEDDED NETWORKING UNIT 5Uploaded byNishanth Asmi
- pgcs2012.pdfUploaded bysvenkatkumar908464
- n10-mincostflowUploaded byttungl
- NCPDUploaded byaseemdalal
- 10.1.1.85.7672Uploaded byvrouben
- Lecture8- Transportataion-SPP.ppsxUploaded byAhmed El-Dahshan
- Elementry Graph AlgorithmUploaded byNeha Verma
- 2012_A Discrete Event Model for Real Time System SimulationUploaded byademargcjunior
- R TutorialUploaded byqwertyraul
- lecture3-casfasegment2Uploaded byAnkur Kothari
- SocialMediaLab Package TutorialUploaded byShinji Ikari
- Block Size-based Measures of StreetUploaded byJorge Luís Stocker Jr.
- Robust ImageGraph Rank-Level Feature Fusion ForUploaded byHOD EEE
- xmlUploaded byGhila G
- Mba ClickstreamUploaded bySarbani Dasgupts
- Lee Christensen Rudd 1966Uploaded byNidha Kusuma
- gvgen.1Uploaded bypanna1
- Information RetrievalUploaded byNB
- presentation.pdfUploaded byHanif Rahmat
- Total Irregularity Strength for Cartesian Product Two PathUploaded byMuhammad Riski Maulana
- 01.2 Ship scheduling with soft time window.pdfUploaded byJuliano Moura

- Johnny Bunko Career GuideUploaded byDanielus Medrano
- Deep Learning ChatbotUploaded byjeromeku
- Largescale3DUploaded byjeromeku
- 01 SummaryUploaded byjeromeku
- How Change Happens Consultation Draft 281015 EnUploaded byjeromeku
- Mobile RoboticsUploaded byjeromeku
- Industrial DLUploaded byjeromeku
- AI 10 to WatchUploaded byjeromeku
- 101 AlphasUploaded bysovacap
- Zhang - Thinking Analysis to the Process of Mathematical CreativityUploaded byjeromeku
- lecun2015Uploaded byJohn Sun
- Targetted LearningUploaded byjeromeku
- UnicornGraphSearchDatabaseUploaded byPiyush Ahuja
- Med Device ParkinsonsUploaded byjeromeku
- Math Mind BendersUploaded byjeromeku
- Deep Speech 2Uploaded byjeromeku
- S5715 Keynote Jen Hsun HuangUploaded byjeromeku
- SalesUploaded byjeromeku
- L27.fa12Uploaded byjeromeku
- FuelUploaded byjeromeku
- Mapping the Connected WorUploaded byjeromeku
- Analytics the Real World Use of Big Data in Financial Services Mai 2013Uploaded byjeromeku
- Systems of Automation WilUploaded byjeromeku
- WW IoT Taxonomy 2013Uploaded byjeromeku
- Can High-Frequency Trading Drive the Stock Market Off a CliffUploaded byjeromeku

- 09 Graph Decomposition Problems 1Uploaded byGuru Prasad Iyer
- A Survey on Algorithms for Optimal Path Search in Dynamic NetworksUploaded byijcsn
- 12 Graphs ShortestPathUploaded byfrankjamison
- Mathematical InductionUploaded byFahimAbrar
- 025Uploaded byMuhammadAzka
- DAA TutorialsUploaded bydivyadarshan18
- 20122cha1Uploaded byPi
- Hamilton Path.pdfUploaded byFred
- Single Source Shortest PathsUploaded byAbhijit Panda
- 17683_graph Theory and Related Data Structures (1)Uploaded byism33
- Maths explosionUploaded bySallyAce
- Matgraph - A Matlab Toolbox for Graph TheoryUploaded byTan Duy
- DS Lab ManualUploaded byRaghavendra Apv
- Shortest pathsUploaded byAndjel Petrovic
- Graphs and Trees Lecture9Uploaded bytheresa.painter
- S S D P P Labelling of Snake Graphs SunojUploaded byInternational Journal of Advanced and Innovative Research
- Midterm 2 SolUploaded byDavid Mollin
- Chapter 12Uploaded byPerrioer Mathew
- Algebraic.Graph.Theory.Morphisms,.Monoids.and.Matrices,..Knauer,.De.Gruyter,.2011.pdfUploaded byviyerod
- Rothvoss NotesUploaded byLi Du
- adaNotes-1Uploaded bypankajghorela
- ShortestPathsUploaded byShivam Pandey
- Agent Advanced Traveler InformationUploaded byHelloproject
- gephi-tutorial-visualization.pdfUploaded bytonitt
- 24142Uploaded byShikha Agarwal
- 93542greedy MethodUploaded byYogesh Tonpe
- DynProg_FloydWarshallUploaded bysathyadhoni
- BacktrackingUploaded byrashed44
- Dijkstra's Shortest Path Algorithm Serial and Parallel Execution Performance AnalysisUploaded byMircea Trifan
- 05-Unit5Uploaded byJohn Arthur

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.