cs126 digraphs

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/9

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

10 Terms

1
New cards

What is a digraph?

A directed graph // A graph whose edges are all direct

2
New cards

What are some applications of digraphs?

  • One-way streets

  • Flights

  • Task scheduling

3
New cards

What are the properties of a diagraph?

  • Each edge goes in one direction

  • If it is simple, m ≤ n(n-1)

4
New cards

How can a digraph be used to implement task scheduling?

Edge (a,b) means task a must be completed before b can be started.

5
New cards

Name the (4) types of edge when a DFS traverses a direct graph.

  • Discovery edges

  • Back edges

  • Cross Edges

  • Forward edges

6
New cards

What does a directed DFS achieve?

It determines the vertices reachable from the start vertex.

7
New cards

What are some applications of directed acyclic graphs (DAGs)?

  • Prerequisites between modules 

  • Inheritance between classes in OOP

  • Scheduling tasks of a project

8
New cards

Define topological ordering.

  • A numbering of vertices of a diagraph: v0, v1,

  • For every edge (vi, vj), we have i < j

  • A diagraph admits a topology order, iff it is a DAG

9
New cards

Define topological sorting.

An algorithm that computes a topological ordering of a DAG.

10
New cards

Describe how to perform a topological sorting using a DFS.

  1. Set n* to (number of vertices - 1)

  2. Mark v as visited

  3. For all outgoing edges (v,w)

    • If w is unvisited:

      • Repeat from (2) with w

  4. Label v with topological number n

  5. Decrement n