├── .gitignore ├── documents ├── syllabus.md ├── syllabus.pdf └── syllabus.tex ├── license.md ├── misc └── runScriptExamples │ ├── cEx │ ├── hello.c │ └── run.sh │ ├── cppEx │ ├── hello.cpp │ └── run.sh │ ├── csEx │ ├── Hello.cs │ └── run.sh │ ├── nodeEx │ ├── hello.js │ └── run.sh │ ├── phpEx │ ├── hello.php │ └── run.sh │ ├── pythonEx │ ├── hello.py │ └── run.sh │ ├── readme.md │ ├── rubyEx │ ├── hello.rb │ └── run.sh │ ├── rustEx │ ├── hello.rs │ └── run.sh │ └── swiftEx │ ├── hello.swift │ └── run.sh ├── notes ├── 1197-Summer2019 │ ├── 0.0-CourseIntroduction.pdf │ ├── 1.0-BruteForce.pdf │ ├── 2.0-DivideConquer.pdf │ ├── 3-LinearSystems.pdf │ ├── 4-BSTHuffmanCoding.pdf │ ├── 5-treesAndHashses.pdf │ ├── 6-GraphAlgos.pdf │ ├── 7-DynamicProg.pdf │ ├── 8-ComputationA.pdf │ └── 8-ComputationB.pdf ├── 1207-Summer2020 │ ├── 0-introduction.md │ ├── 1-bruteForce.md │ ├── 2-divideConquer.md │ ├── 3-DataStructures.md │ ├── 4-Graphs.md │ ├── 5-DynamicProgramming.md │ ├── 6-Computation.md │ ├── demo.py │ ├── graphDemo │ │ ├── foo.txt │ │ ├── graphDemo.py │ │ ├── graphNxUtils.py │ │ ├── mygraph.pdf │ │ ├── mygraph.tex │ │ ├── mytree.pdf │ │ ├── mytree.tex │ │ ├── test.py │ │ ├── testCases │ │ │ ├── input001.txt │ │ │ ├── input002.txt │ │ │ ├── input003.txt │ │ │ ├── input004.txt │ │ │ ├── input005.txt │ │ │ ├── input006.txt │ │ │ ├── input007.txt │ │ │ ├── input008.txt │ │ │ ├── input009.txt │ │ │ ├── input010.txt │ │ │ ├── input011.txt │ │ │ ├── input012.txt │ │ │ ├── input013.txt │ │ │ ├── input014.txt │ │ │ ├── input015.txt │ │ │ ├── input016.txt │ │ │ ├── input017.txt │ │ │ ├── input018.txt │ │ │ ├── input019.txt │ │ │ ├── input020.txt │ │ │ ├── input021.txt │ │ │ ├── input022.txt │ │ │ ├── input023.txt │ │ │ ├── input024.txt │ │ │ ├── input025.txt │ │ │ ├── input026.txt │ │ │ ├── input028.txt │ │ │ ├── input029.txt │ │ │ ├── input030.txt │ │ │ ├── input031.txt │ │ │ ├── input033.txt │ │ │ ├── input034.txt │ │ │ ├── input035.txt │ │ │ ├── input036.txt │ │ │ ├── input037.txt │ │ │ ├── input038.txt │ │ │ ├── input039.txt │ │ │ ├── input040.txt │ │ │ ├── input041.txt │ │ │ ├── input042.txt │ │ │ ├── input043.txt │ │ │ ├── input044.txt │ │ │ ├── input045.txt │ │ │ ├── input046.txt │ │ │ ├── input047.txt │ │ │ ├── input048.txt │ │ │ ├── input049.txt │ │ │ ├── input050.txt │ │ │ ├── input051.txt │ │ │ ├── input052.txt │ │ │ ├── input053.txt │ │ │ ├── input054.txt │ │ │ ├── input055.txt │ │ │ ├── input056.txt │ │ │ ├── input057.txt │ │ │ ├── input058.txt │ │ │ ├── input059.txt │ │ │ ├── input060.txt │ │ │ ├── input061.txt │ │ │ ├── input062.txt │ │ │ ├── input063.txt │ │ │ ├── input064.txt │ │ │ ├── input065.txt │ │ │ ├── input066.txt │ │ │ ├── input067.txt │ │ │ ├── input068.txt │ │ │ ├── input069.txt │ │ │ ├── input070.txt │ │ │ ├── input071.txt │ │ │ ├── output001.txt │ │ │ ├── output002.txt │ │ │ ├── output003.txt │ │ │ ├── output004.txt │ │ │ ├── output005.txt │ │ │ ├── output006.txt │ │ │ ├── output007.txt │ │ │ ├── output008.txt │ │ │ ├── output009.txt │ │ │ ├── output010.txt │ │ │ ├── output011.txt │ │ │ ├── output012.txt │ │ │ ├── output013.txt │ │ │ ├── output014.txt │ │ │ ├── output015.txt │ │ │ ├── output016.txt │ │ │ ├── output017.txt │ │ │ ├── output018.txt │ │ │ ├── output019.txt │ │ │ ├── output020.txt │ │ │ ├── output021.txt │ │ │ ├── output022.txt │ │ │ ├── output023.txt │ │ │ ├── output024.txt │ │ │ ├── output025.txt │ │ │ ├── output026.txt │ │ │ ├── output028.txt │ │ │ ├── output029.txt │ │ │ ├── output030.txt │ │ │ ├── output031.txt │ │ │ ├── output033.txt │ │ │ ├── output034.txt │ │ │ ├── output035.txt │ │ │ ├── output036.txt │ │ │ ├── output037.txt │ │ │ ├── output038.txt │ │ │ ├── output039.txt │ │ │ ├── output040.txt │ │ │ ├── output041.txt │ │ │ ├── output042.txt │ │ │ ├── output043.txt │ │ │ ├── output044.txt │ │ │ ├── output045.txt │ │ │ ├── output046.txt │ │ │ ├── output047.txt │ │ │ ├── output048.txt │ │ │ ├── output049.txt │ │ │ ├── output050.txt │ │ │ ├── output051.txt │ │ │ ├── output052.txt │ │ │ ├── output053.txt │ │ │ ├── output054.txt │ │ │ ├── output055.txt │ │ │ ├── output056.txt │ │ │ ├── output057.txt │ │ │ ├── output058.txt │ │ │ ├── output059.txt │ │ │ ├── output060.txt │ │ │ ├── output061.txt │ │ │ ├── output062.txt │ │ │ ├── output063.txt │ │ │ ├── output064.txt │ │ │ ├── output065.txt │ │ │ ├── output066.txt │ │ │ ├── output067.txt │ │ │ ├── output068.txt │ │ │ ├── output069.txt │ │ │ ├── output070.txt │ │ │ └── output071.txt │ │ ├── tikz-network.sty │ │ └── weightedGraph.txt │ └── scratch.md ├── 1217-Summer2021 │ ├── 0-intro.md │ ├── 1-bruteForce.md │ ├── 2-divideConquer.md │ ├── 3-dataStructures.md │ ├── 4-graphAlgorithms.md │ ├── 5-dynamicProgramming.md │ └── 6-Computation.md ├── 1218-Fall2021 │ ├── 0-intro.md │ ├── 1-BruteForce.md │ ├── 2-DivideAndConquer.md │ ├── 3-DataStructures.md │ ├── 4-GraphAlgos.md │ ├── 5-DynamicProgramming.md │ ├── 6-Computation.md │ ├── Module3.pdf │ ├── Module4-Graphs.pdf │ ├── Module5-DynamicProgramming.pdf │ ├── Module6-Computation.pdf │ └── Modules1-2.pdf ├── 1228-Fall2022 │ ├── 0-intro.md │ ├── 1-bruteForceAlgos.md │ ├── 2-divideConquer.md │ ├── 3-dataStructures.md │ ├── 4-GraphAlgos.md │ ├── 5-DynamicProgramming.md │ ├── 6-Computation.md │ └── code │ │ ├── closestPairBruteForce.py │ │ ├── k-combo.py │ │ ├── permutations.py │ │ └── subsets.py └── 1238-Fall2023 │ └── 0-intro.md └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | # latex temporary files 2 | *.acn 3 | *.acr 4 | *.alg 5 | *.aux 6 | *.bbl 7 | *.blg 8 | *.glg 9 | *.glo 10 | *.gls 11 | *.idx 12 | *.ilg 13 | *.ind 14 | *.ist 15 | *.loa 16 | *.lof 17 | *.log 18 | *.lol 19 | *.out 20 | *.synctex.gz 21 | *.toc 22 | *.xwm 23 | 24 | # 25 | *~ 26 | 27 | # minted subdirectory 28 | _minted-* 29 | figures/_minted* 30 | 31 | # 32 | .DS_Store 33 | 34 | # development files in notes 35 | notes/*/dev 36 | demo.py 37 | -------------------------------------------------------------------------------- /documents/syllabus.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/documents/syllabus.pdf -------------------------------------------------------------------------------- /misc/runScriptExamples/cEx/hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /** 5 | * A basic hello world program in C 6 | */ 7 | int main(int argc, char **argv) { 8 | 9 | int i; 10 | printf("Hello World!\n"); 11 | printf("You passed:\n"); 12 | 13 | for(i=0; i 2 | 3 | using namespace std; 4 | 5 | /** 6 | * A basic hello world program in C++ 7 | */ 8 | int main(int argc, char **argv) { 9 | 10 | cout << "Hello World" << endl; 11 | for(int i=0; i $v) { 6 | printf("argv[%2d] = %s\n", $k, $v); 7 | } 8 | 9 | ?> -------------------------------------------------------------------------------- /misc/runScriptExamples/phpEx/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | php hello.php "$@" 4 | -------------------------------------------------------------------------------- /misc/runScriptExamples/pythonEx/hello.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | print("Hello World!") 4 | print("You passed arguments: ") 5 | print(str(sys.argv)) 6 | -------------------------------------------------------------------------------- /misc/runScriptExamples/pythonEx/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # On the cse server, multiple versions of python 4 | # are available and you can invoke a specific one 5 | # if you wish. You can use a pyenv utility to 6 | # find the available versions. 7 | # pyenv versions 8 | # lists all the installe versions and 9 | # pyenv which python3.7 10 | # (for example) to list the full path to a particular 11 | # version. You'll likely be okay simply using python 12 | # (which is python3 by default) 13 | # for all of your programs as in the following example. 14 | python hello.py "$@" 15 | -------------------------------------------------------------------------------- /misc/runScriptExamples/readme.md: -------------------------------------------------------------------------------- 1 | # Computer Science III 2 | ### `run.sh` Script Examples 3 | 4 | Generally this course's programming exercises are *language agnostic*. 5 | They are designed for generic input and your program(s) must 6 | parse/process the input. You are ***highly encouraged*** to solve 7 | these exercises in a language you are not already familiar with so as 8 | to use this as an opportunity to expand your toolbox. The vast 9 | majority of students choose to use Python 3. 10 | 11 | To facilitate the use of any language, you are required to provide 12 | a `run.sh` script file that contains the commands to compile and 13 | execute your program as well as pass any command line arguments 14 | on to your program. This will enable us to run your program on 15 | the CSE server. This repository provides examples of `run.sh` 16 | scripts for several major languages. A basic "hello world" program 17 | has been included to demonstrate usage. 18 | 19 | -------------------------------------------------------------------------------- /misc/runScriptExamples/rubyEx/hello.rb: -------------------------------------------------------------------------------- 1 | puts "Hello World" 2 | puts "You input" 3 | ARGV.each do|a| 4 | puts "Argument: #{a}" 5 | end -------------------------------------------------------------------------------- /misc/runScriptExamples/rubyEx/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ruby hello.rb "$@" 4 | 5 | -------------------------------------------------------------------------------- /misc/runScriptExamples/rustEx/hello.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | 3 | fn main() { 4 | 5 | // Print text to the console 6 | println!("Hello World!"); 7 | 8 | // The first argument is the path that was used to call the program. 9 | println!("My path is {}.", args[0]); 10 | 11 | // The rest of the arguments are the passed command line parameters. 12 | // Call the program like this: 13 | // $ ./args arg1 arg2 14 | println!("I got {:?} arguments: {:?}.", args.len() - 1, &args[1..]); 15 | } -------------------------------------------------------------------------------- /misc/runScriptExamples/rustEx/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #if the executable hello does not already exist, compile it 4 | if ! [ -a hello ]; then 5 | rustc -o helll hello.rs 6 | fi 7 | 8 | # run the executable, passing command line arguments 9 | ./hello "$@" 10 | 11 | -------------------------------------------------------------------------------- /misc/runScriptExamples/swiftEx/hello.swift: -------------------------------------------------------------------------------- 1 | print("Hello, world!") -------------------------------------------------------------------------------- /misc/runScriptExamples/swiftEx/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #if the executable hello does not already exist, compile it 4 | if ! [ -a hello ]; then 5 | swiftc -o hello hello.swift 6 | fi 7 | 8 | # run the executable, passing command line arguments 9 | ./hello "$@" 10 | 11 | -------------------------------------------------------------------------------- /notes/1197-Summer2019/0.0-CourseIntroduction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1197-Summer2019/0.0-CourseIntroduction.pdf -------------------------------------------------------------------------------- /notes/1197-Summer2019/1.0-BruteForce.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1197-Summer2019/1.0-BruteForce.pdf -------------------------------------------------------------------------------- /notes/1197-Summer2019/2.0-DivideConquer.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1197-Summer2019/2.0-DivideConquer.pdf -------------------------------------------------------------------------------- /notes/1197-Summer2019/3-LinearSystems.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1197-Summer2019/3-LinearSystems.pdf -------------------------------------------------------------------------------- /notes/1197-Summer2019/4-BSTHuffmanCoding.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1197-Summer2019/4-BSTHuffmanCoding.pdf -------------------------------------------------------------------------------- /notes/1197-Summer2019/5-treesAndHashses.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1197-Summer2019/5-treesAndHashses.pdf -------------------------------------------------------------------------------- /notes/1197-Summer2019/6-GraphAlgos.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1197-Summer2019/6-GraphAlgos.pdf -------------------------------------------------------------------------------- /notes/1197-Summer2019/7-DynamicProg.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1197-Summer2019/7-DynamicProg.pdf -------------------------------------------------------------------------------- /notes/1197-Summer2019/8-ComputationA.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1197-Summer2019/8-ComputationA.pdf -------------------------------------------------------------------------------- /notes/1197-Summer2019/8-ComputationB.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1197-Summer2019/8-ComputationB.pdf -------------------------------------------------------------------------------- /notes/1207-Summer2020/0-introduction.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III 3 | ## CSCE 310 - Summer 2020 4 | ### Course Introduction 5 | 6 | 7 | # Administrivia 8 | 9 | * Introduction 10 | * Chris Bourke 11 | * Molly Lee 12 | * "Roll" 13 | * Course Format 14 | * Lecture 15 | * Office Hours 16 | * Online Course Tip 17 | * Canvas/other resources 18 | 19 | Fun with latex: 20 | $$\sum_{i=1}^n i = \frac{n(n+1)}{2}$$ 21 | 22 | * Syllabus 23 | * Assignments 24 | * Submission of written solutions 25 | * Submission of programs 26 | * Exams 27 | 28 | # Review 29 | 30 | * Prerequisites for this course: CS1, CS2, Discrete Math 31 | * Proficiency in programming 32 | * Searching & Sorting Algorithms 33 | * Basic Algorithms & Algorithm Analysis 34 | * Basic Data Structures: stacks, queues, lists, binary search trees, graphs 35 | * Proofs and logic 36 | * Basic Combinatorics 37 | 38 | ## Review & Motivating Example 39 | 40 | * Problem: 41 | * Given: a collection of points in the cartesian plane 42 | * Output: the minimal distance between any two points 43 | 44 | ### Algo Analysis: 45 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/2-divideConquer.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III 3 | ## CSCE 310 - Summer 2020 4 | ### Divide & Conquer Algorithms 5 | 6 | ### Introduction 7 | 8 | * Divide a problem into smaller problems 9 | * Until each problem is trivially solvable 10 | * May need to combine sub-solutions to produce a larger solution 11 | * Usually presented as recursive, but doesn't have to be 12 | * Well-suited for parallelization and distributed computing 13 | * MapReduce 14 | * Searching & Sorting 15 | * Tournament style operations 16 | 17 | ### Examples and Tools 18 | 19 | * General divide & conquer approach on arrays for searching for a particular element 20 | * Divide by a constant 21 | 22 | ```python 23 | 24 | a = [4, 5, 2, 3, 9, 2, 3] 25 | 26 | def search(a, i, key): 27 | if i >= len(a): 28 | return None 29 | elif a[i] == key: 30 | return i 31 | else: 32 | return search(a, i+1, key) 33 | 34 | index = search(a, 0, 3) 35 | print(index) 36 | ``` 37 | 38 | * Divide by a factor: dividing into two or more parts 39 | 40 | ```python 41 | 42 | import math 43 | 44 | a = [0, 1, 4, 5, 2, 3, 9, 2, 3, 42] 45 | 46 | def search(a, l, r, key): 47 | m = math.floor((l + r) / 2) 48 | if l > r: 49 | return None 50 | elif a[m] == key: 51 | return m 52 | else: 53 | #search the left: 54 | i = search(a, l, m-1, key) 55 | if i is not None: 56 | return i 57 | return search(a, m+1, r, key) 58 | 59 | index = search(a, 0, len(a)-1, 0) 60 | print(index) 61 | ``` 62 | 63 | #### Master Theorem 64 | 65 | Let $T(n)$ be a monotonically increasing function that satisfies 66 | 67 | \[ 68 | \begin{array}{lcl} 69 | T(n) & = & aT(\frac{n}{b}) + f(n)\\ 70 | T(1) & = & c 71 | \end{array}\] 72 | 73 | where $a \geq 1, b \geq 2, c> 0$. If $f(n) \in \Theta(n^d)$ where $d \geq 0$, then 74 | 75 | \[T(n) = \left\{ 76 | \begin{array}{lcl} 77 | \Theta(n^d) & \mathrm{~if~} a < b^d\\ 78 | \Theta(n^d\log{n}) & \mathrm{~if~} a = b^d\\ 79 | \Theta(n^{\log_b{a}}) & \mathrm{~if~} a > b^d 80 | \end{array}\right.\] 81 | 82 | ### Closest Pair of Points 83 | 84 | * Divide & Conquer approach work for the closest pair of points? 85 | * Divide the set of points into two sets 86 | * Recursively find the two closest points in each subset 87 | * When you have a subset of size 2: trivially, those two points are the closest 88 | * Observation: there are only a constant number of points that we have to consider on the right hand side which gives us a recurrence: 89 | 90 | $$C(n) = 2C(n/2) + O(n)$$ 91 | 92 | * By the master theorem, this gives us $\Theta(n\log{n})$ 93 | 94 | ### Repeated Squaring/Fast Binary Exponentiation 95 | 96 | * Task: compute 97 | \[ a^n \mod m \] 98 | for "large" $n$ 99 | * A naive approach of making $n-1$ multiplications leads to an exponential inefficiency 100 | * Repeated squaring: compute $a, a^2, a^4, a^8, \ldots$ using only 1 multiplication each 101 | * Include the result depending on the bit representation of $a$ 102 | * Leads to a $O(\log{n}) = O(N)$ where $N$ is the *true* input size (linear) 103 | 104 | ### Karatsuba multiplication 105 | 106 | * Can use the FOIL rule to reduce number of multiplications using a recursive divide & conquer approach 107 | 108 | ### Strassen's Matrix Multiplication 109 | 110 | * Normal definition implementation of matrix multiplication of two $n \times n$ matrices requires: 111 | * $n^3$ multiplications 112 | * $n^2(n-1)$ additions 113 | * Both are cubic 114 | * Strassen's identities led to 1 fewer multiplication (for $2 \times 2$ matrices) but 18 additions 115 | * Strassen's identities generalize to any $n \times n$ matrix 116 | * Problem: to divide evenly each time all through the recursion, requires matrices that are of size some power of 2: $n = 2^k$ 117 | * You can always pad out a matrix with zeros (left, right, bottom, top) without changing its values 118 | * When you are done, you can "trim" 119 | * How much better is this? 120 | * The number of multiplications made by Strassen is $O(n^{2.8074})$ 121 | * Likewise, the same analysis can show you that the number of additions is *also* $O(n^{2.8074})$ 122 | * Other improvements: 123 | * Winogard: $O(n^{2.3756})$ 124 | * Williams: $O(n^{2.3727})$ 125 | 126 | ### More Matrices: Gaussian elimination 127 | 128 | * Not directly related to divide & conquer BUT it involves matrices 129 | * Indirectly related to divide & conquer with respect to the *determinant* of a matrix 130 | * THe determinant of a $n \times n$ matrix models the "signed volume" of a linear transformation or a "parallelogram" in $n$-dimensional space 131 | * The "official" definition of the determinant is 132 | $$\det{A} = \sum_{\sigma \in S_n} \left[ \mathrm{sgn}(\sigma) \prod_{i=1}^n A_{i, \sigma_i} \right]$$ 133 | where $S_n$ is the symmetric group on $n$ elements (the set of all permutations). 134 | 135 | Divide & Conquer: 136 | 137 | \[\det A = \sum_{j=1}^n s_j a_{1j}\det{A_j}\] 138 | 139 | where 140 | 141 | \[s_j = 142 | \left\{\begin{array}{ll} 143 | 1 & \textrm{if $j$ is odd}\\ 144 | -1 & \textrm{if $j$ is even} 145 | \end{array}\right.\] 146 | 147 | * $a_{1j}$ is the element in row 1 and column $j$ 148 | * $A_j$ is the $(n-1) \times (n-1)$ matrix obtained by deleting row 1 149 | and column $j$ from $A$ 150 | * If $n = 1$ then $\det{A} = a_{11}$ 151 | 152 | * Observation: the determinant of an upper-diagonal matrix (triangular matrix) is simply the product of its diagonal elements 153 | * You can apply various elementary operations to a matrix to make into an upper diagonal matrix and preserve the value of the determinant. 154 | 155 | ## Linear Systems 156 | 157 | * Given $n$ equations with $n$ variables $\vec{x} = (v_1, \ldots, v_n)$ 158 | * Build an augmented matrix $A\vec{b}$ 159 | * Make the matrix upper triangular: elements below the diagonal are all zero 160 | * for each row $i$: we make elements in column $i$ zero below the element $a_{i,i}$ 161 | 162 | ```text 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | ``` -------------------------------------------------------------------------------- /notes/1207-Summer2020/4-Graphs.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III 3 | ## CSCE 310 - Summer 2020 4 | ### Graph Algorithms 5 | 6 | #### Introduction 7 | 8 | * Undirected: edges have no orientation (x, y) = (y, x) 9 | * Directed graphs: edges have an orientation (x,y) is not the same (y,x) 10 | * Unweighted graphs: all edges have uniform weights of 1 11 | * Weighted graphs: each edge may have a weight associated with it 12 | * Many ways to implement graphs: 13 | * Adjacency matrices 14 | * Adjacency list 15 | * Sets of pairs of vertices (sets of edges) 16 | * Recommendation: NetworkX https://networkx.github.io/ 17 | 18 | #### Depth First Search 19 | 20 | * Depth First Search: searches a graph as deep as possible first before backtracking 21 | * We want to make sure that we make progress: we don't want to visit or process a vertex more than once, and we don't want to get stuck in a loop 22 | * Tree traversal algorithms: preorder, postorder, inorder traversals are all DFS 23 | * Go as deep into the graph as possible, only backtracking when we hit a dead end 24 | * Keep track of vital information: 25 | * Have you visited this vertex before? 26 | * Have you processed this vertex already? 27 | * When did you first see this vertex? 28 | * When did you last see this vertex? 29 | 30 | * DFS traversal can produce several artifacts 31 | * DFS Tree/Forest: 32 | * Tree Edges: edges that are traversed in the DFS traversal 33 | * Back Edges: connect a descendent in the DFS tree to an ancestor 34 | * Forward Edges: connect an ancestor in the DFS to a descendent 35 | * Cross Edges: connect components in a DFS forest 36 | * Observations: 37 | * In an undirected graph, only tree/back edges are possible (forward/back are the same thing) 38 | * In an undirected graph: the presence of a back edge implies a cycle 39 | * Directed: a back edge indicates a cycle, 40 | * Directed: all four types of edges are possible 41 | 42 | #### Breadth First Search 43 | 44 | * Alternative: explore the "closest" vertices first 45 | * Closest = *distance*, not necessarily *weighted distance* 46 | 47 | * Observations 48 | * In a BFS Tree, no back/forward edges are possible in an undirected graph 49 | * In a BFS Tree, forward edges are not possible, but back edges are in a directed graph 50 | * With BFS, the finishing/starting time stamps have the exact same order (FIFO) 51 | * Cross edges in a BFS connect cousins/aunts, etc. They do NOT connect descendents/ancestors 52 | * A BFS tree identifies a shortest path *from the initial vertex* to any other connected vertex in an unweighted graph: BFS is a single source shortest path algorithm 53 | 54 | #### Applications 55 | 56 | * Connectivity: Given two vertices $x, y \in V$, determine if there is a path from $x$ to $y$ (directed, undirected, etc.) 57 | * Topological Sorting: given a poset (partially ordered set), output a consistent total order 58 | * Run DFS and note the finishing times 59 | * Sort the elements in descending order according to the finishing time stamps 60 | * The resulting order is a total order consistent with the poset 61 | * Cycle detection: detect a cycle by finding forward/back or cross edges (undirected graphs) 62 | * Bipartite Testing: given a graph $G$ is it bipartite 63 | * Condensation graphs: often you want to *simplify* a graph topology 64 | * You can take an arbitrary digraph (directed graph) possibly with cycles and *collapse* it into an "equivalent" graph without cycles 65 | * Collapses *strongly connected vertices*: there is a path from $x$ to $y$ AND a path from $y$ to $x$ 66 | * The result is a DAG: Directed Acyclic Graph that preserves connectivity 67 | * Run DFS once, keeping track of the finish times 68 | * Reverse the graph (transpose graph) and run DFS on it 69 | * Each time the second DFS restarts, you start a new Strongly Connected Component 70 | * You can add edges based on connectivity in the original graph 71 | 72 | ## Minimum Spanning Trees 73 | 74 | * Given an undirected weighted graph (edges have weights), we want to create a 75 | *spanning tree* of minimal total weight 76 | * A spanning tree is simply a tree that connects all of the vertices into one graph 77 | * If your graph is disconnected, there is no spanning tree, but you *can* create a spanning forest 78 | * In general, there may be many minimum spanning trees 79 | 80 | ### Kruskal's Algorithm 81 | 82 | * Greedy: we'll consider the least weighted edges first, we'll include the edge if and only if it does not *induce* a cycle 83 | * Outline: 84 | * Presort all the edges in non-decreasing order 85 | * You add the edge to the MST $T$ if and only if it does not create a cycle 86 | * You stop after you have added $n-1$ edges OR you run out of edges to consider 87 | 88 | ### Prim's Algorithm 89 | 90 | * We don't do cycle detection 91 | * Instead, we iteratively build a tree starting at an arbitrary vertex 92 | * Throughout the algorithm we build a "frontier" of "fringe" vertices/edges 93 | * We expand the tree, adding a "fringe" vertex on each iteration 94 | 95 | 96 | ### Shortest Distance Algorithms: Dijkstra's 97 | 98 | * Start at a *source* vertex $s4 99 | * Produces a shortest-path from $s$ to all other vertices 100 | * Works on directed or undirected graphs with edge weights 101 | * It updates a list of triples: vertex, distance to the vertex (from $s$) and the *predecessor* or how to get there 102 | * It uses a min-heap/priority queue to store references to the vertices 103 | * BUT: when using the min-heap, you need the ability to update the priority/weight 104 | 105 | ### Shortest Distance Algorithm: Floyd-Warshall Algorithm 106 | 107 | * 108 | 109 | ```text 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | ``` 122 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/5-DynamicProgramming.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III 3 | ## CSCE 310 - Summer 2020 4 | ### Dynamic Programming 5 | 6 | ## Introduction 7 | 8 | * "Dynamic" = fancy marketing term 9 | * Basic Idea: 10 | * Divide & Conquer approach to problem solving 11 | * Eliminate redundant recursion with memoization (caching) 12 | * Eliminate remaining recursions by identifying a tableau (table) and filling it out 13 | 14 | ### Example: computing binomials 15 | 16 | * Consider: 17 | $${n \choose k}$$ 18 | * Straightforward solution: 19 | $${n \choose k} = \frac{n!}{(n-k)!k!}$$ 20 | * Pascal's Identity: 21 | $${n \choose k} = {n-1 \choose k-1} + {n-1 \choose k}$$ 22 | * Base cases: 23 | $${n \choose n} = 1 = {n \choose 0}$$ 24 | 25 | * Basic Steps 26 | * Identify a value that represents the optimal of a problem 27 | * Identify a recurrence identity in terms of values to "smaller" problems 28 | * Prove your recurrence is correct ("Optimal Substructure Property"; its just a simple application of induction) 29 | * Identify trivial base cases 30 | * Identify the desired final result 31 | * Setup a tableau that holds values to subsolutions (and possibly additional data to reconstruct solutions) 32 | * Fill in cells corresponding to the trivial base cases 33 | * Identify the cell corresponding to the final result 34 | * Identify how cells relate to each other 35 | * Fill out cells in the table in an order so that needed values are cached 36 | 37 | ## Problem: Optimal Binary Search Trees 38 | 39 | * Given a set of keys and probabilities of searching for those keys... 40 | * We want to build a binary search tree that minimizes the average number of key comparisons 41 | 42 | ## Problem: Dynamic 0-1 Knapsack 43 | 44 | * Given a collection of items with weights and values and a capacity $W$, we want to maximize our total value subject to the capacity 45 | * Steal as much stuff as we can carry (maximize value) 46 | 47 | 48 | ```text 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | ``` -------------------------------------------------------------------------------- /notes/1207-Summer2020/demo.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import math 3 | from array import * 4 | import numpy as np 5 | 6 | n = int(sys.argv[1]) 7 | k = int(sys.argv[2]) 8 | 9 | P=[[0 for i in range(k+1)] for j in range(n+1)] # initialize 10 | 11 | for i in range(n+1): 12 | for j in range(k+1): 13 | if j == 0 or i == j: 14 | P[i][j] = 1 15 | else: 16 | P[i][j] = P[i-1][j-1] + P[i-1][j] 17 | 18 | r = P[n][k] 19 | 20 | print(str(n) + " choose " + str(k) + " = " + str(r)) 21 | 22 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/foo.txt: -------------------------------------------------------------------------------- 1 | 0 1 {'weight': 11.1} 2 | 0 2 {'weight': 10.9} 3 | 0 3 {'weight': 10.5} 4 | 0 4 {'weight': 10.1} 5 | 0 5 {'weight': 9.7} 6 | 0 6 {'weight': 9.3} 7 | 1 7 {'weight': 8.9} 8 | 1 9 {'weight': 8.5} 9 | 2 9 {'weight': 4.1} 10 | 2 10 {'weight': 3.7} 11 | 3 10 {'weight': 7.3} 12 | 3 12 {'weight': 6.9} 13 | 4 12 {'weight': 3.3} 14 | 4 13 {'weight': 2.9} 15 | 5 13 {'weight': 5.7} 16 | 5 15 {'weight': 5.3} 17 | 6 7 {'weight': 2.5} 18 | 6 15 {'weight': 2.1} 19 | 7 8 {'weight': 8.1} 20 | 8 9 {'weight': 7.7} 21 | 10 11 {'weight': 6.5} 22 | 11 12 {'weight': 6.1} 23 | 13 14 {'weight': 4.9} 24 | 14 15 {'weight': 4.5} 25 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/graphDemo.py: -------------------------------------------------------------------------------- 1 | import networkx as nx 2 | from network2tikz import plot 3 | from graphNxUtils import nxWeightedGraphFromFile 4 | from collections import deque 5 | 6 | #https://networkx.github.io/documentation/stable/tutorial.html 7 | #https://pypi.org/project/network2tikz/ 8 | 9 | g = nxWeightedGraphFromFile("./testCases/input007.txt") 10 | 11 | #print(g.edges.data()) 12 | 13 | #requires matlibplot: nx.draw(g) 14 | style = {} 15 | style['node_label'] = [str(x) for x in g.nodes] 16 | style['edge_curved'] = 0 17 | style['layout'] = 'fruchterman_reingold' 18 | style['edge_label'] = [wt for (x,y,wt) in g.edges.data('weight')] 19 | plot(g,'mygraph.tex',**style) 20 | 21 | #now the real fun begins... 22 | 23 | # Let's write a function that: 24 | # given a graph G, two vertices, a, b returns 25 | # a path from a to be if one exists 26 | # let's adapt DFS to solve this problem 27 | 28 | def findPath(g, a, b): 29 | """ 30 | Finds a path in the graph g from the vertex a 31 | to the vertex b if one exists. No conditions 32 | (shortest distance or weighted path) are placed 33 | on the resulting path. Returns None if no such 34 | path exists 35 | """ 36 | #maps verticies to strings for their status 37 | # including "unvisited", "visited", "processed" 38 | status = {x:"unvisited" for x in g.nodes} 39 | s = [] # my stack: append or pop 40 | s.append(a) 41 | status[a] = "visited" 42 | while len(s) > 0: 43 | curr = s[-1] 44 | # check if you've found b: 45 | if curr == b: 46 | return s 47 | # select the next vertex to visit... 48 | next = None 49 | #print("curr = " + str(curr)) 50 | for y in g.neighbors(curr): 51 | if status[y] == "unvisited": 52 | next = y 53 | break 54 | if next is None: 55 | #done with curr, need to backtrack 56 | s.pop() 57 | status[curr] = "processed" 58 | else: 59 | # go to the *next* vertex: 60 | status[next] = "visited" 61 | s.append(next) 62 | return None 63 | 64 | 65 | def bfsTree(g, a): 66 | """ 67 | returns a BFS tree resulting from one BFS 68 | run starting at vertex a 69 | """ 70 | t = nx.Graph() 71 | t.add_nodes_from(range(len(g.nodes))) 72 | q = deque() #popleft(), append() 73 | #maps verticies to strings for their status 74 | # including "unvisited", "visited", "processed" 75 | status = {x:"unvisited" for x in g.nodes} 76 | #start with a: 77 | status[a] = "visited" 78 | q.append(a) 79 | while len(q) > 0: 80 | curr = q.popleft() 81 | for y in g.neighbors(curr): 82 | if status[y] == "unvisited": 83 | status[y] = "visited" 84 | q.append(y) 85 | # add the edge from curr to y to the BFS tree 86 | t.add_edge(curr, y, weight=g[curr][y]['weight']) 87 | status[curr] = "processed" 88 | return t 89 | 90 | 91 | 92 | t = bfsTree(g, 0) 93 | plot(t,'mytree.tex',**style) 94 | 95 | nx.write_edgelist(g, "foo.txt") 96 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/graphNxUtils.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import networkx as nx 3 | 4 | def nxGraphFromFile(fileName): 5 | """ 6 | Parses a text file representation of a graph and 7 | produces a NetworkX (nx) graph instance of an 8 | undirected graph. 9 | 10 | The format of the file is as follows: 11 | - first line: n, the number of vertices in G 12 | - each line after is an adjacency list - an initial 13 | vertex followed by a space-delimited list of 14 | vertices it is incident on 15 | 16 | See https://networkx.github.io/documentation 17 | """ 18 | g = nx.Graph() 19 | try: 20 | lines = open(fileName,'r').readlines() 21 | except FileNotFoundError: 22 | sys.stderr.write("File not found: " + fileName + "\n") 23 | return g 24 | n = int(lines[0].strip()) 25 | g.add_nodes_from(range(n)) 26 | for x in range(n): 27 | line = lines[x+1] 28 | tokens = line.strip().split(" ") 29 | for y in tokens[1:]: 30 | g.add_edge(x,int(y)) 31 | return g.to_undirected() 32 | 33 | def nxWeightedGraphFromFile(fileName): 34 | """ 35 | Parses a text file representation of a graph and 36 | produces a NetworkX (nx) graph instance of an 37 | undirected graph with edge weights (stored as 38 | attributes on edges). 39 | 40 | The format of the file is as follows: 41 | - first line: n, the number of vertices in G 42 | - each line after is a space-delimited triple 43 | representing an edge: two vertices followed 44 | by the weight of the edge 45 | 46 | See https://networkx.github.io/documentation 47 | """ 48 | g = nx.Graph() 49 | try: 50 | lines = open(fileName,'r').readlines() 51 | except FileNotFoundError: 52 | sys.stderr.write("File not found: " + fileName + "\n") 53 | return g 54 | n = int(lines[0].strip()) 55 | g.add_nodes_from(range(n)) 56 | for line in lines[1:]: 57 | tokens = line.strip().split(" ") 58 | if len(tokens) == 3: 59 | g.add_edge(int(tokens[0]),int(tokens[1]),weight=float(tokens[2])) 60 | return g.to_undirected() 61 | 62 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/mygraph.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1207-Summer2020/graphDemo/mygraph.pdf -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/mygraph.tex: -------------------------------------------------------------------------------- 1 | \documentclass{standalone} 2 | \usepackage{tikz-network} 3 | \begin{document} 4 | \begin{tikzpicture} 5 | \clip (0,0) rectangle (6,6); 6 | \Vertex[x=2.533,y=3.346,label=0]{0} 7 | \Vertex[x=2.087,y=1.865,label=1]{1} 8 | \Vertex[x=0.998,y=2.992,label=2]{2} 9 | \Vertex[x=1.472,y=4.467,label=3]{3} 10 | \Vertex[x=2.989,y=4.841,label=4]{4} 11 | \Vertex[x=4.051,y=3.690,label=5]{5} 12 | \Vertex[x=3.628,y=2.224,label=6]{6} 13 | \Vertex[x=2.733,y=1.011,label=7]{7} 14 | \Vertex[x=1.632,y=0.350,label=8]{8} 15 | \Vertex[x=1.065,y=1.490,label=9]{9} 16 | \Vertex[x=0.382,y=4.388,label=10]{10} 17 | \Vertex[x=0.387,y=5.650,label=11]{11} 18 | \Vertex[x=1.655,y=5.544,label=12]{12} 19 | \Vertex[x=4.505,y=4.681,label=13]{13} 20 | \Vertex[x=5.618,y=4.081,label=14]{14} 21 | \Vertex[x=4.912,y=3.044,label=15]{15} 22 | \Edge[,bend=0,label=11.1](0)(1) 23 | \Edge[,bend=0,label=10.9](0)(2) 24 | \Edge[,bend=0,label=10.5](0)(3) 25 | \Edge[,bend=0,label=10.1](0)(4) 26 | \Edge[,bend=0,label=9.7](0)(5) 27 | \Edge[,bend=0,label=9.3](0)(6) 28 | \Edge[,bend=0,label=8.9](1)(7) 29 | \Edge[,bend=0,label=8.5](1)(9) 30 | \Edge[,bend=0,label=4.1](2)(9) 31 | \Edge[,bend=0,label=3.7](2)(10) 32 | \Edge[,bend=0,label=7.3](3)(10) 33 | \Edge[,bend=0,label=6.9](3)(12) 34 | \Edge[,bend=0,label=3.3](4)(12) 35 | \Edge[,bend=0,label=2.9](4)(13) 36 | \Edge[,bend=0,label=5.7](5)(13) 37 | \Edge[,bend=0,label=5.3](5)(15) 38 | \Edge[,bend=0,label=2.5](6)(7) 39 | \Edge[,bend=0,label=2.1](6)(15) 40 | \Edge[,bend=0,label=8.1](7)(8) 41 | \Edge[,bend=0,label=7.7](8)(9) 42 | \Edge[,bend=0,label=6.5](10)(11) 43 | \Edge[,bend=0,label=6.1](11)(12) 44 | \Edge[,bend=0,label=4.9](13)(14) 45 | \Edge[,bend=0,label=4.5](14)(15) 46 | \end{tikzpicture} 47 | \end{document} -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/mytree.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1207-Summer2020/graphDemo/mytree.pdf -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/mytree.tex: -------------------------------------------------------------------------------- 1 | \documentclass{standalone} 2 | \usepackage{tikz-network} 3 | \begin{document} 4 | \begin{tikzpicture} 5 | \clip (0,0) rectangle (6,6); 6 | \Vertex[x=2.919,y=2.563,label=0]{0} 7 | \Vertex[x=4.007,y=2.064,label=1]{1} 8 | \Vertex[x=1.892,y=2.197,label=2]{2} 9 | \Vertex[x=3.545,y=3.244,label=3]{3} 10 | \Vertex[x=2.501,y=3.575,label=4]{4} 11 | \Vertex[x=2.807,y=1.649,label=5]{5} 12 | \Vertex[x=2.430,y=2.795,label=6]{6} 13 | \Vertex[x=4.943,y=1.884,label=7]{7} 14 | \Vertex[x=5.650,y=1.706,label=8]{8} 15 | \Vertex[x=4.342,y=1.479,label=9]{9} 16 | \Vertex[x=1.011,y=1.896,label=10]{10} 17 | \Vertex[x=0.350,y=1.660,label=11]{11} 18 | \Vertex[x=4.027,y=3.795,label=12]{12} 19 | \Vertex[x=2.130,y=4.430,label=13]{13} 20 | \Vertex[x=1.853,y=5.078,label=14]{14} 21 | \Vertex[x=2.703,y=0.922,label=15]{15} 22 | \Edge[,bend=0,label=11.1](0)(1) 23 | \Edge[,bend=0,label=10.9](0)(2) 24 | \Edge[,bend=0,label=10.5](0)(3) 25 | \Edge[,bend=0,label=10.1](0)(4) 26 | \Edge[,bend=0,label=9.7](0)(5) 27 | \Edge[,bend=0,label=9.3](0)(6) 28 | \Edge[,bend=0,label=8.9](1)(7) 29 | \Edge[,bend=0,label=8.5](1)(9) 30 | \Edge[,bend=0,label=4.1](2)(10) 31 | \Edge[,bend=0,label=3.7](3)(12) 32 | \Edge[,bend=0,label=7.3](4)(13) 33 | \Edge[,bend=0,label=6.9](5)(15) 34 | \Edge[,bend=0,label=3.3](7)(8) 35 | \Edge[,bend=0,label=2.9](10)(11) 36 | \Edge[,bend=0,label=5.7](13)(14) 37 | \end{tikzpicture} 38 | \end{document} -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/test.py: -------------------------------------------------------------------------------- 1 | import networkx as nx 2 | from graphNxUtils import nxWeightedGraphFromFile 3 | 4 | g = nxWeightedGraphFromFile("./testCases/input007.txt") 5 | nx.write_edgelist(g, "foo.txt") 6 | 7 | h = nx.read_edgelist("foo.txt") 8 | 9 | print(h) 10 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input001.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 1 5.0 3 | 0 2 3.0 4 | 0 3 4.0 5 | 0 4 2.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input002.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 1 3.0 3 | 0 2 2.0 4 | 0 3 1.0 5 | 2 5 3.0 6 | 3 4 6.0 7 | 4 5 10.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input003.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 1 1.0 3 | 0 3 2.0 4 | 1 3 3.0 5 | 1 2 2.0 6 | 2 3 4.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input004.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 1 1.0 3 | 0 2 3.0 4 | 0 3 4.0 5 | 1 2 2.0 6 | 1 3 5.0 7 | 2 3 6.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input005.txt: -------------------------------------------------------------------------------- 1 | 8 2 | 0 2 3.0 3 | 0 3 2.1 4 | 0 4 4.3 5 | 1 2 3.14 6 | 1 3 2.5 7 | 2 3 3.9 8 | 2 4 10.3 9 | 5 7 5 10 | 6 7 6 11 | 5 6 8 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input006.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 0 1 10 3 | 1 2 15 4 | 2 3 16 5 | 2 4 9 6 | 3 4 11 7 | 3 5 20 8 | 4 7 25 9 | 5 6 5 10 | 5 7 8 11 | 7 8 30 12 | 7 9 4 13 | 8 9 12 14 | 0 9 3 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input007.txt: -------------------------------------------------------------------------------- 1 | 16 2 | 0 1 11.1 3 | 0 2 10.9 4 | 0 3 10.5 5 | 0 4 10.1 6 | 0 5 9.7 7 | 0 6 9.3 8 | 1 7 8.9 9 | 1 9 8.5 10 | 8 7 8.1 11 | 8 9 7.7 12 | 3 10 7.3 13 | 3 12 6.9 14 | 11 10 6.5 15 | 11 12 6.1 16 | 5 13 5.7 17 | 5 15 5.3 18 | 14 13 4.9 19 | 14 15 4.5 20 | 2 9 4.1 21 | 2 10 3.7 22 | 4 12 3.3 23 | 4 13 2.9 24 | 6 7 2.5 25 | 6 15 2.1 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input008.txt: -------------------------------------------------------------------------------- 1 | 9 2 | 0 1 1.1 3 | 0 2 1.1 4 | 1 2 1.1 5 | 3 4 5.5 6 | 3 5 5.5 7 | 4 5 5.5 8 | 6 7 30.1 9 | 6 8 40.1 10 | 7 8 50.1 11 | 0 3 100.1 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input009.txt: -------------------------------------------------------------------------------- 1 | 12 2 | 0 4 22.0 3 | 0 5 13.0 4 | 1 2 7.5 5 | 1 5 1.0 6 | 1 4 8.1 7 | 2 5 3.2 8 | 2 8 4.7 9 | 3 5 6.0 10 | 4 5 9.0 11 | 6 7 12.3 12 | 7 8 3.3 13 | 8 1 4.8 14 | 8 6 4.2 15 | 9 1 15.2 16 | 10 2 48.3 17 | 11 10 12.2 18 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input010.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 2 40 3 | 0 3 31 4 | 0 1 53 5 | 1 2 41.4 6 | 1 3 35 7 | 2 3 49 8 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input011.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 2 3.0 3 | 0 3 2.1 4 | 0 4 4.3 5 | 1 2 3.14 6 | 1 3 2.5 7 | 2 3 3.9 8 | 2 4 10.3 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input012.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 2 3.0 3 | 0 3 2.1 4 | 0 4 4.3 5 | 1 2 3.14 6 | 1 3 2.5 7 | 2 3 3.9 8 | 2 4 15 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input013.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 2 3.0 3 | 0 3 2.1 4 | 1 2 3.14 5 | 1 3 2.5 6 | 2 3 3.9 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input014.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 0 2 3.0 3 | 1 2 3.14 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input015.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 1 5.0 3 | 0 2 1.0 4 | 1 3 7.0 5 | 2 3 3.0 6 | 1 4 2.0 7 | 3 4 4.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input016.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 1 2.7 3 | 0 3 3.3 4 | 1 4 7.1 5 | 2 4 4.45 6 | 2 5 6.8 7 | 3 4 1.26 8 | 4 5 5.59 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input017.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 0 1 1.0 3 | 0 2 2.0 4 | 1 2 4.0 5 | 3 4 3.0 6 | 3 5 5.0 7 | 3 6 2.0 8 | 4 5 4.0 9 | 5 6 2.0 10 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input018.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 0 1 5.7 3 | 0 4 7.3 4 | 0 6 2.0 5 | 1 4 5.1 6 | 1 6 3.5 7 | 2 3 8.1 8 | 2 4 7.2 9 | 2 5 6.7 10 | 3 4 3.3 11 | 3 5 4.2 12 | 4 6 2.3 13 | 4 5 9.4 14 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input019.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 1 50.0 3 | 0 5 20.0 4 | 1 5 18.0 5 | 2 5 12.5 6 | 2 4 30.0 7 | 3 5 25.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input020.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 0 1 2 3 | 1 2 4 4 | 2 3 6 5 | 3 4 8 6 | 4 5 10 7 | 4 9 12 8 | 5 6 14 9 | 7 8 30 10 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input021.txt: -------------------------------------------------------------------------------- 1 | 9 2 | 0 2 4.0 3 | 2 3 2.1 4 | 3 8 3.1 5 | 8 1 2.22 6 | 1 6 1.22 7 | 1 5 7.05 8 | 5 4 2.5 9 | 4 7 3.7 10 | 1 4 1.11 11 | 0 1 0.5 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input022.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 3 1 3.1 3 | 2 0 2.1 4 | 2 3 1.2 5 | 0 1 0.5 6 | 2 4 0.2 7 | 4 5 1.55 8 | 1 5 7.1 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input023.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 1 4 3 | 0 2 2 4 | 2 3 1 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input024.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 1 1 3 | 0 2 2 4 | 1 3 5 5 | 2 4 6 6 | 2 5 4 7 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input025.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 2 3 3 | 0 5 4 4 | 1 5 3.1 5 | 1 4 4.1 6 | 1 2 2 7 | 2 5 1.1 8 | 2 4 1.3 9 | 2 3 7 10 | 3 4 8 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input026.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 0 1 10 3 | 0 2 10.1 4 | 0 3 10.2 5 | 0 4 10.3 6 | 0 5 10.1 7 | 0 6 10.2 8 | 1 4 10.3 9 | 1 2 10.4 10 | 2 6 10 11 | 2 4 10.1 12 | 2 3 10.2 13 | 3 6 10.3 14 | 3 4 10 15 | 4 6 10.4 16 | 4 5 10.5 17 | 5 6 10.20 18 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input028.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 1 1.0 3 | 0 4 1.0 4 | 1 2 1.0 5 | 1 4 1.0 6 | 2 3 1.0 7 | 2 4 1.0 8 | 3 4 1.0 9 | 3 0 1.0 10 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input029.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 2 5.0 3 | 0 3 2.1 4 | 1 2 2.5 5 | 1 3 5.8 6 | 2 3 3.5 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input030.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 0 1 1.5 3 | 0 2 1.5 4 | 0 3 2.0 5 | 0 4 2.5 6 | 1 3 3.5 7 | 1 4 3.5 8 | 2 5 4.0 9 | 3 4 1.5 10 | 3 6 3.5 11 | 4 5 1.5 12 | 4 6 1.5 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input031.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 0 3 4.2 3 | 0 1 4.1 4 | 1 3 10.2 5 | 2 3 0.1 6 | 3 5 2.3 7 | 3 6 2.4 8 | 3 4 8.2 9 | 4 5 1.0 10 | 5 6 11.3 11 | 7 8 8.0 12 | 7 9 2.3 13 | 8 9 9.5 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input033.txt: -------------------------------------------------------------------------------- 1 | 8 2 | 0 1 8.6 3 | 0 2 3.4 4 | 0 7 20.5 5 | 1 3 7.7 6 | 1 5 30.2 7 | 1 7 11.7 8 | 2 5 15.8 9 | 3 4 6.4 10 | 4 5 4.6 11 | 6 7 1.9 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input034.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 1 4.5 3 | 0 3 7.3 4 | 1 2 5.6 5 | 1 3 3.4 6 | 2 3 6.8 7 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input035.txt: -------------------------------------------------------------------------------- 1 | 9 2 | 0 1 15 3 | 0 2 25 4 | 1 4 10 5 | 1 7 5 6 | 1 8 25 7 | 2 3 10 8 | 2 4 20 9 | 4 5 10 10 | 4 6 5 11 | 7 8 15 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input036.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 0 1 18.76 3 | 0 2 66.25 4 | 1 3 8.07 5 | 1 4 90.28 6 | 2 5 59.51 7 | 2 6 53.02 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input037.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 1 2 3 | 0 2 5 4 | 0 4 4 5 | 0 5 1.7 6 | 3 4 3 7 | 3 5 3.5 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input038.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 0 3 1.1 3 | 0 4 3 4 | 0 5 1.3 5 | 0 6 2 6 | 1 4 2.7 7 | 2 5 10 8 | 2 4 4 9 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input039.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 1 4.0 3 | 0 5 2.0 4 | 1 2 5.0 5 | 1 4 5.0 6 | 2 3 6.0 7 | 2 5 3.0 8 | 3 4 7.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input040.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 4 2.0 3 | 0 5 3.0 4 | 1 2 7.0 5 | 1 3 1.0 6 | 1 4 8.0 7 | 2 5 3.0 8 | 3 5 6.0 9 | 4 5 9.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input041.txt: -------------------------------------------------------------------------------- 1 | 9 2 | 0 4 2.0 3 | 0 5 3.0 4 | 1 2 7.0 5 | 1 3 1.0 6 | 1 4 8.0 7 | 2 5 3.0 8 | 3 5 6.0 9 | 4 5 9.0 10 | 6 7 12.3 11 | 7 8 3.3 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input042.txt: -------------------------------------------------------------------------------- 1 | 11 2 | 0 4 2.0 3 | 0 5 3.0 4 | 1 2 7.0 5 | 1 3 1.0 6 | 1 4 8.0 7 | 2 5 3.0 8 | 3 5 6.0 9 | 4 5 9.0 10 | 6 7 12.3 11 | 7 8 3.3 12 | 9 10 66.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input043.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 1 3.0 3 | 0 2 2.1 4 | 0 3 4.3 5 | 1 2 1.14 6 | 1 3 2.5 7 | 2 3 1.9 8 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input044.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 4 2.0 3 | 0 5 3.14 4 | 1 3 7.2 5 | 1 4 1.0 6 | 1 5 8.0 7 | 2 5 3.0 8 | 3 4 6.9 9 | 3 5 2.89 10 | 4 5 9.7 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input045.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 2 3.0 3 | 0 3 2.1 4 | 0 4 4.3 5 | 1 2 3.14 6 | 1 3 2.5 7 | 2 3 3.9 8 | 2 4 10.3 9 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input046.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 1 4.0 3 | 0 5 2.0 4 | 1 2 5.0 5 | 1 4 5.0 6 | 2 3 6.0 7 | 2 5 3.0 8 | 3 4 7.0 9 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input047.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 1 5 3 | 0 2 2.3 4 | 0 3 5 5 | 0 4 4.2 6 | 1 2 4.5 7 | 1 3 6 8 | 2 3 3.9 9 | 2 4 34 10 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input048.txt: -------------------------------------------------------------------------------- 1 | 9 2 | 0 4 3.0 3 | 0 5 6.0 4 | 1 2 7.0 5 | 1 3 1.0 6 | 1 4 8.0 7 | 2 5 3.0 8 | 3 5 6.0 9 | 4 5 9.0 10 | 4 7 1.0 11 | 4 8 3.0 12 | 6 7 12.3 13 | 7 8 3.3 14 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input049.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 1 1 3 | 1 2 1 4 | 2 3 1 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input050.txt: -------------------------------------------------------------------------------- 1 | 18 2 | 0 1 3 3 | 1 5 4 4 | 1 4 5 5 | 1 3 4 6 | 1 2 3 7 | 6 7 2 8 | 7 8 2 9 | 8 9 4 10 | 9 10 3 11 | 10 11 2 12 | 12 13 2 13 | 13 14 3 14 | 14 15 4 15 | 15 16 5 16 | 16 17 6 17 | 17 12 7 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input051.txt: -------------------------------------------------------------------------------- 1 | 8 2 | 0 1 3 3 | 0 2 6 4 | 0 3 4 5 | 1 2 2 6 | 1 3 10 7 | 1 4 11 8 | 2 3 7 9 | 4 5 3 10 | 5 6 7 11 | 5 7 7 12 | 6 7 15 13 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input052.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 0 1 3 3 | 0 2 6 4 | 0 3 4 5 | 1 2 2 6 | 1 3 10 7 | 1 4 11 8 | 2 3 7 9 | 4 5 3 10 | 5 6 15 11 | 5 7 7 12 | 6 7 7 13 | 8 9 1 14 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input053.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 1 4.0 3 | 0 2 2.0 4 | 1 2 6.0 5 | 1 3 3.0 6 | 2 3 5.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input054.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 2 7.0 3 | 1 2 3.0 4 | 2 3 2.0 5 | 2 4 1.0 6 | 3 4 2.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input055.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 2 2.0 3 | 0 4 7.6 4 | 1 3 9.9 5 | 1 2 5.1 6 | 1 4 20 7 | 1 0 19 8 | 2 3 2.3 9 | 4 2 6.6 10 | 4 3 7.8 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input056.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 1 1 3 | 0 2 3 4 | 0 3 8 5 | 1 2 7.3 6 | 1 3 21.2 7 | 2 3 8.45 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input057.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 1 .5 3 | 0 2 15.1 4 | 1 2 13.2 5 | 2 3 10.5 6 | 3 4 20.5 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input058.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 4 3 3 | 4 1 2 4 | 4 2 5 5 | 4 3 7 6 | 1 2 1 7 | 1 3 2 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input059.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 2 1.4 3 | 1 2 3.0 4 | 2 3 2.5 5 | 2 4 4.2 6 | 3 4 3.1 7 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input060.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 1 3.0 3 | 0 2 4.0 4 | 1 2 1.0 5 | 2 3 2.0 6 | 2 4 5.0 7 | 3 4 6.0 8 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input061.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 1 1.0 3 | 0 2 1.0 4 | 0 3 3.0 5 | 1 2 5.0 6 | 1 3 1.0 7 | 2 3 2.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input062.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 2 0.2 3 | 0 1 0.1 4 | 1 2 0.25 5 | 3 4 0.5 6 | 3 5 1.0 7 | 4 5 0.25 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input063.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 1 3 3 | 0 2 5.4 4 | 0 3 3.1 5 | 0 4 0.3 6 | 0 5 10 7 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input064.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 1 5.0 3 | 0 2 2.5 4 | 0 3 7.5 5 | 1 3 2.5 6 | 1 5 7.5 7 | 2 3 5.0 8 | 2 4 2.5 9 | 4 5 1.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input065.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 3 1.0 3 | 0 4 2.0 4 | 1 2 3.0 5 | 1 4 1.0 6 | 2 3 2.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input066.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 1 3.0 3 | 0 2 6.5 4 | 0 3 4.3 5 | 1 2 11 6 | 2 3 2.5 7 | 2 4 6 8 | 3 4 10.3 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input067.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 0 2 3.0 3 | 0 3 6.5 4 | 0 5 4.3 5 | 1 2 4.2 6 | 2 4 2.5 7 | 2 6 5 8 | 3 4 10.3 9 | 5 6 7.98 10 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input068.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 2 7.7 3 | 1 4 2.1 4 | 2 3 1.0 5 | 2 4 4.2 6 | 3 4 1.8 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input069.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 0 1 1.0 3 | 1 2 4.3 4 | 2 3 2.2 5 | 2 5 3.2 6 | 3 4 1.8 7 | 5 4 1.0 8 | 4 6 7.2 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input070.txt: -------------------------------------------------------------------------------- 1 | 9 2 | 0 1 2.0 3 | 0 7 4.0 4 | 1 8 8.2 5 | 1 2 3.3 6 | 2 3 9.0 7 | 2 4 1.1 8 | 2 5 2.7 9 | 3 7 3.4 10 | 4 7 3.0 11 | 4 6 5.0 12 | 5 8 4.7 13 | 5 6 5.8 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/input071.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 0 1 2.1 3 | 1 2 3.0 4 | 1 3 2.4 5 | 3 2 1.0 6 | 3 0 2.1 -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output001.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 5.000) 3 | (0, 2, 3.000) 4 | (0, 3, 4.000) 5 | (0, 4, 2.000) 6 | 7 | Depth First Traversal (vertex visited order): 8 | [0, 1, 2, 3, 4] 9 | 10 | Breadth First Traversal (lowest-weight-next): 11 | [0, 4, 2, 3, 1] 12 | 13 | Minimum Spanning Tree: 14 | (0, 1, 5.000) 15 | (0, 2, 3.000) 16 | (0, 3, 4.000) 17 | (0, 4, 2.000) 18 | Type: Full Spanning Tree 19 | Total Weight: 14.000 20 | 21 | Shortest Paths: 22 | 0 -> 1: 23 | (0,1,5.00) 24 | Path Weight: 5.00 25 | 0 -> 2: 26 | (0,2,3.00) 27 | Path Weight: 3.00 28 | 0 -> 3: 29 | (0,3,4.00) 30 | Path Weight: 4.00 31 | 0 -> 4: 32 | (0,4,2.00) 33 | Path Weight: 2.00 34 | 1 -> 2: 35 | (1,0,5.00) -> (0,2,3.00) 36 | Path Weight: 8.00 37 | 1 -> 3: 38 | (1,0,5.00) -> (0,3,4.00) 39 | Path Weight: 9.00 40 | 1 -> 4: 41 | (1,0,5.00) -> (0,4,2.00) 42 | Path Weight: 7.00 43 | 2 -> 3: 44 | (2,0,3.00) -> (0,3,4.00) 45 | Path Weight: 7.00 46 | 2 -> 4: 47 | (2,0,3.00) -> (0,4,2.00) 48 | Path Weight: 5.00 49 | 3 -> 4: 50 | (3,0,4.00) -> (0,4,2.00) 51 | Path Weight: 6.00 52 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output002.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 3.000) 3 | (0, 2, 2.000) 4 | (0, 3, 1.000) 5 | (2, 5, 3.000) 6 | (3, 4, 6.000) 7 | (4, 5, 10.000) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 1, 2, 5, 4, 3] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 3, 2, 1, 4, 5] 14 | 15 | Minimum Spanning Tree: 16 | (0, 1, 3.000) 17 | (0, 2, 2.000) 18 | (0, 3, 1.000) 19 | (2, 5, 3.000) 20 | (3, 4, 6.000) 21 | Type: Full Spanning Tree 22 | Total Weight: 15.000 23 | 24 | Shortest Paths: 25 | 0 -> 1: 26 | (0,1,3.00) 27 | Path Weight: 3.00 28 | 0 -> 2: 29 | (0,2,2.00) 30 | Path Weight: 2.00 31 | 0 -> 3: 32 | (0,3,1.00) 33 | Path Weight: 1.00 34 | 0 -> 4: 35 | (0,3,1.00) -> (3,4,6.00) 36 | Path Weight: 7.00 37 | 0 -> 5: 38 | (0,2,2.00) -> (2,5,3.00) 39 | Path Weight: 5.00 40 | 1 -> 2: 41 | (1,0,3.00) -> (0,2,2.00) 42 | Path Weight: 5.00 43 | 1 -> 3: 44 | (1,0,3.00) -> (0,3,1.00) 45 | Path Weight: 4.00 46 | 1 -> 4: 47 | (1,0,3.00) -> (0,3,1.00) -> (3,4,6.00) 48 | Path Weight: 10.00 49 | 1 -> 5: 50 | (1,0,3.00) -> (0,2,2.00) -> (2,5,3.00) 51 | Path Weight: 8.00 52 | 2 -> 3: 53 | (2,0,2.00) -> (0,3,1.00) 54 | Path Weight: 3.00 55 | 2 -> 4: 56 | (2,0,2.00) -> (0,3,1.00) -> (3,4,6.00) 57 | Path Weight: 9.00 58 | 2 -> 5: 59 | (2,5,3.00) 60 | Path Weight: 3.00 61 | 3 -> 4: 62 | (3,4,6.00) 63 | Path Weight: 6.00 64 | 3 -> 5: 65 | (3,0,1.00) -> (0,2,2.00) -> (2,5,3.00) 66 | Path Weight: 6.00 67 | 4 -> 5: 68 | (4,5,10.00) 69 | Path Weight: 10.00 70 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output003.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 1.000) 3 | (0, 3, 2.000) 4 | (1, 2, 2.000) 5 | (1, 3, 3.000) 6 | (2, 3, 4.000) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 1, 2, 3] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 1, 3, 2] 13 | 14 | Minimum Spanning Tree: 15 | (0, 1, 1.000) 16 | (0, 3, 2.000) 17 | (1, 2, 2.000) 18 | Type: Full Spanning Tree 19 | Total Weight: 5.000 20 | 21 | Shortest Paths: 22 | 0 -> 1: 23 | (0,1,1.00) 24 | Path Weight: 1.00 25 | 0 -> 2: 26 | (0,1,1.00) -> (1,2,2.00) 27 | Path Weight: 3.00 28 | 0 -> 3: 29 | (0,3,2.00) 30 | Path Weight: 2.00 31 | 1 -> 2: 32 | (1,2,2.00) 33 | Path Weight: 2.00 34 | 1 -> 3: 35 | (1,3,3.00) 36 | Path Weight: 3.00 37 | 2 -> 3: 38 | (2,3,4.00) 39 | Path Weight: 4.00 40 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output004.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 1.000) 3 | (0, 2, 3.000) 4 | (0, 3, 4.000) 5 | (1, 2, 2.000) 6 | (1, 3, 5.000) 7 | (2, 3, 6.000) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 1, 2, 3] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 1, 2, 3] 14 | 15 | Minimum Spanning Tree: 16 | (0, 1, 1.000) 17 | (0, 3, 4.000) 18 | (1, 2, 2.000) 19 | Type: Full Spanning Tree 20 | Total Weight: 7.000 21 | 22 | Shortest Paths: 23 | 0 -> 1: 24 | (0,1,1.00) 25 | Path Weight: 1.00 26 | 0 -> 2: 27 | (0,2,3.00) 28 | Path Weight: 3.00 29 | 0 -> 3: 30 | (0,3,4.00) 31 | Path Weight: 4.00 32 | 1 -> 2: 33 | (1,2,2.00) 34 | Path Weight: 2.00 35 | 1 -> 3: 36 | (1,3,5.00) 37 | Path Weight: 5.00 38 | 2 -> 3: 39 | (2,3,6.00) 40 | Path Weight: 6.00 41 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output005.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 2, 3.000) 3 | (0, 3, 2.100) 4 | (0, 4, 4.300) 5 | (1, 2, 3.140) 6 | (1, 3, 2.500) 7 | (2, 3, 3.900) 8 | (2, 4, 10.300) 9 | (5, 6, 8.000) 10 | (5, 7, 5.000) 11 | (6, 7, 6.000) 12 | 13 | Depth First Traversal (vertex visited order): 14 | [0, 2, 1, 3, 4, 5, 6, 7] 15 | 16 | Breadth First Traversal (lowest-weight-next): 17 | [0, 3, 2, 4, 1, 5, 7, 6] 18 | 19 | Minimum Spanning Tree: 20 | (0, 2, 3.000) 21 | (0, 3, 2.100) 22 | (0, 4, 4.300) 23 | (1, 3, 2.500) 24 | (5, 7, 5.000) 25 | (6, 7, 6.000) 26 | Type: Spanning Forrest 27 | Total Weight: 22.900 28 | 29 | Shortest Paths: 30 | 0 -> 1: 31 | (0,3,2.10) -> (3,1,2.50) 32 | Path Weight: 4.60 33 | 0 -> 2: 34 | (0,2,3.00) 35 | Path Weight: 3.00 36 | 0 -> 3: 37 | (0,3,2.10) 38 | Path Weight: 2.10 39 | 0 -> 4: 40 | (0,4,4.30) 41 | Path Weight: 4.30 42 | 0 -> 5: 43 | no path 44 | 0 -> 6: 45 | no path 46 | 0 -> 7: 47 | no path 48 | 1 -> 2: 49 | (1,2,3.14) 50 | Path Weight: 3.14 51 | 1 -> 3: 52 | (1,3,2.50) 53 | Path Weight: 2.50 54 | 1 -> 4: 55 | (1,3,2.50) -> (3,0,2.10) -> (0,4,4.30) 56 | Path Weight: 8.90 57 | 1 -> 5: 58 | no path 59 | 1 -> 6: 60 | no path 61 | 1 -> 7: 62 | no path 63 | 2 -> 3: 64 | (2,3,3.90) 65 | Path Weight: 3.90 66 | 2 -> 4: 67 | (2,0,3.00) -> (0,4,4.30) 68 | Path Weight: 7.30 69 | 2 -> 5: 70 | no path 71 | 2 -> 6: 72 | no path 73 | 2 -> 7: 74 | no path 75 | 3 -> 4: 76 | (3,0,2.10) -> (0,4,4.30) 77 | Path Weight: 6.40 78 | 3 -> 5: 79 | no path 80 | 3 -> 6: 81 | no path 82 | 3 -> 7: 83 | no path 84 | 4 -> 5: 85 | no path 86 | 4 -> 6: 87 | no path 88 | 4 -> 7: 89 | no path 90 | 5 -> 6: 91 | (5,6,8.00) 92 | Path Weight: 8.00 93 | 5 -> 7: 94 | (5,7,5.00) 95 | Path Weight: 5.00 96 | 6 -> 7: 97 | (6,7,6.00) 98 | Path Weight: 6.00 99 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output006.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 10.000) 3 | (0, 9, 3.000) 4 | (1, 2, 15.000) 5 | (2, 3, 16.000) 6 | (2, 4, 9.000) 7 | (3, 4, 11.000) 8 | (3, 5, 20.000) 9 | (4, 7, 25.000) 10 | (5, 6, 5.000) 11 | (5, 7, 8.000) 12 | (7, 8, 30.000) 13 | (7, 9, 4.000) 14 | (8, 9, 12.000) 15 | 16 | Depth First Traversal (vertex visited order): 17 | [0, 1, 2, 3, 4, 7, 5, 6, 8, 9] 18 | 19 | Breadth First Traversal (lowest-weight-next): 20 | [0, 9, 1, 7, 8, 2, 5, 4, 3, 6] 21 | 22 | Minimum Spanning Tree: 23 | (0, 9, 3.000) 24 | (0, 1, 10.000) 25 | (1, 2, 15.000) 26 | (2, 4, 9.000) 27 | (3, 4, 11.000) 28 | (5, 6, 5.000) 29 | (5, 7, 8.000) 30 | (7, 9, 4.000) 31 | (8, 9, 12.000) 32 | Type: Full Spanning Tree 33 | Total Weight: 77.000 34 | 35 | Shortest Paths: 36 | 0 -> 1: 37 | (0,1,10.00) 38 | Path Weight: 10.00 39 | 0 -> 2: 40 | (0,1,10.00) -> (1,2,15.00) 41 | Path Weight: 25.00 42 | 0 -> 3: 43 | (0,9,3.00) -> (9,7,4.00) -> (7,5,8.00) -> (5,3,20.00) 44 | Path Weight: 35.00 45 | 0 -> 4: 46 | (0,9,3.00) -> (9,7,4.00) -> (7,4,25.00) 47 | Path Weight: 32.00 48 | 0 -> 5: 49 | (0,9,3.00) -> (9,7,4.00) -> (7,5,8.00) 50 | Path Weight: 15.00 51 | 0 -> 6: 52 | (0,9,3.00) -> (9,7,4.00) -> (7,5,8.00) -> (5,6,5.00) 53 | Path Weight: 20.00 54 | 0 -> 7: 55 | (0,9,3.00) -> (9,7,4.00) 56 | Path Weight: 7.00 57 | 0 -> 8: 58 | (0,9,3.00) -> (9,8,12.00) 59 | Path Weight: 15.00 60 | 0 -> 9: 61 | (0,9,3.00) 62 | Path Weight: 3.00 63 | 1 -> 2: 64 | (1,2,15.00) 65 | Path Weight: 15.00 66 | 1 -> 3: 67 | (1,2,15.00) -> (2,3,16.00) 68 | Path Weight: 31.00 69 | 1 -> 4: 70 | (1,2,15.00) -> (2,4,9.00) 71 | Path Weight: 24.00 72 | 1 -> 5: 73 | (1,0,10.00) -> (0,9,3.00) -> (9,7,4.00) -> (7,5,8.00) 74 | Path Weight: 25.00 75 | 1 -> 6: 76 | (1,0,10.00) -> (0,9,3.00) -> (9,7,4.00) -> (7,5,8.00) -> (5,6,5.00) 77 | Path Weight: 30.00 78 | 1 -> 7: 79 | (1,0,10.00) -> (0,9,3.00) -> (9,7,4.00) 80 | Path Weight: 17.00 81 | 1 -> 8: 82 | (1,0,10.00) -> (0,9,3.00) -> (9,8,12.00) 83 | Path Weight: 25.00 84 | 1 -> 9: 85 | (1,0,10.00) -> (0,9,3.00) 86 | Path Weight: 13.00 87 | 2 -> 3: 88 | (2,3,16.00) 89 | Path Weight: 16.00 90 | 2 -> 4: 91 | (2,4,9.00) 92 | Path Weight: 9.00 93 | 2 -> 5: 94 | (2,3,16.00) -> (3,5,20.00) 95 | Path Weight: 36.00 96 | 2 -> 6: 97 | (2,3,16.00) -> (3,5,20.00) -> (5,6,5.00) 98 | Path Weight: 41.00 99 | 2 -> 7: 100 | (2,1,15.00) -> (1,0,10.00) -> (0,9,3.00) -> (9,7,4.00) 101 | Path Weight: 32.00 102 | 2 -> 8: 103 | (2,1,15.00) -> (1,0,10.00) -> (0,9,3.00) -> (9,8,12.00) 104 | Path Weight: 40.00 105 | 2 -> 9: 106 | (2,1,15.00) -> (1,0,10.00) -> (0,9,3.00) 107 | Path Weight: 28.00 108 | 3 -> 4: 109 | (3,4,11.00) 110 | Path Weight: 11.00 111 | 3 -> 5: 112 | (3,5,20.00) 113 | Path Weight: 20.00 114 | 3 -> 6: 115 | (3,5,20.00) -> (5,6,5.00) 116 | Path Weight: 25.00 117 | 3 -> 7: 118 | (3,5,20.00) -> (5,7,8.00) 119 | Path Weight: 28.00 120 | 3 -> 8: 121 | (3,5,20.00) -> (5,7,8.00) -> (7,9,4.00) -> (9,8,12.00) 122 | Path Weight: 44.00 123 | 3 -> 9: 124 | (3,5,20.00) -> (5,7,8.00) -> (7,9,4.00) 125 | Path Weight: 32.00 126 | 4 -> 5: 127 | (4,3,11.00) -> (3,5,20.00) 128 | Path Weight: 31.00 129 | 4 -> 6: 130 | (4,3,11.00) -> (3,5,20.00) -> (5,6,5.00) 131 | Path Weight: 36.00 132 | 4 -> 7: 133 | (4,7,25.00) 134 | Path Weight: 25.00 135 | 4 -> 8: 136 | (4,7,25.00) -> (7,9,4.00) -> (9,8,12.00) 137 | Path Weight: 41.00 138 | 4 -> 9: 139 | (4,7,25.00) -> (7,9,4.00) 140 | Path Weight: 29.00 141 | 5 -> 6: 142 | (5,6,5.00) 143 | Path Weight: 5.00 144 | 5 -> 7: 145 | (5,7,8.00) 146 | Path Weight: 8.00 147 | 5 -> 8: 148 | (5,7,8.00) -> (7,9,4.00) -> (9,8,12.00) 149 | Path Weight: 24.00 150 | 5 -> 9: 151 | (5,7,8.00) -> (7,9,4.00) 152 | Path Weight: 12.00 153 | 6 -> 7: 154 | (6,5,5.00) -> (5,7,8.00) 155 | Path Weight: 13.00 156 | 6 -> 8: 157 | (6,5,5.00) -> (5,7,8.00) -> (7,9,4.00) -> (9,8,12.00) 158 | Path Weight: 29.00 159 | 6 -> 9: 160 | (6,5,5.00) -> (5,7,8.00) -> (7,9,4.00) 161 | Path Weight: 17.00 162 | 7 -> 8: 163 | (7,9,4.00) -> (9,8,12.00) 164 | Path Weight: 16.00 165 | 7 -> 9: 166 | (7,9,4.00) 167 | Path Weight: 4.00 168 | 8 -> 9: 169 | (8,9,12.00) 170 | Path Weight: 12.00 171 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output008.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 1.100) 3 | (0, 2, 1.100) 4 | (0, 3, 100.100) 5 | (1, 2, 1.100) 6 | (3, 4, 5.500) 7 | (3, 5, 5.500) 8 | (4, 5, 5.500) 9 | (6, 8, 40.100) 10 | (6, 7, 30.100) 11 | (7, 8, 50.100) 12 | 13 | Depth First Traversal (vertex visited order): 14 | [0, 1, 2, 3, 4, 5, 6, 7, 8] 15 | 16 | Breadth First Traversal (lowest-weight-next): 17 | [0, 1, 2, 3, 4, 5, 6, 7, 8] 18 | 19 | Minimum Spanning Tree: 20 | (0, 1, 1.100) 21 | (0, 2, 1.100) 22 | (0, 3, 100.100) 23 | (3, 4, 5.500) 24 | (3, 5, 5.500) 25 | (6, 8, 40.100) 26 | (6, 7, 30.100) 27 | Type: Spanning Forrest 28 | Total Weight: 183.500 29 | 30 | Shortest Paths: 31 | 0 -> 1: 32 | (0,1,1.10) 33 | Path Weight: 1.10 34 | 0 -> 2: 35 | (0,2,1.10) 36 | Path Weight: 1.10 37 | 0 -> 3: 38 | (0,3,100.10) 39 | Path Weight: 100.10 40 | 0 -> 4: 41 | (0,3,100.10) -> (3,4,5.50) 42 | Path Weight: 105.60 43 | 0 -> 5: 44 | (0,3,100.10) -> (3,5,5.50) 45 | Path Weight: 105.60 46 | 0 -> 6: 47 | no path 48 | 0 -> 7: 49 | no path 50 | 0 -> 8: 51 | no path 52 | 1 -> 2: 53 | (1,2,1.10) 54 | Path Weight: 1.10 55 | 1 -> 3: 56 | (1,0,1.10) -> (0,3,100.10) 57 | Path Weight: 101.20 58 | 1 -> 4: 59 | (1,0,1.10) -> (0,3,100.10) -> (3,4,5.50) 60 | Path Weight: 106.70 61 | 1 -> 5: 62 | (1,0,1.10) -> (0,3,100.10) -> (3,5,5.50) 63 | Path Weight: 106.70 64 | 1 -> 6: 65 | no path 66 | 1 -> 7: 67 | no path 68 | 1 -> 8: 69 | no path 70 | 2 -> 3: 71 | (2,0,1.10) -> (0,3,100.10) 72 | Path Weight: 101.20 73 | 2 -> 4: 74 | (2,0,1.10) -> (0,3,100.10) -> (3,4,5.50) 75 | Path Weight: 106.70 76 | 2 -> 5: 77 | (2,0,1.10) -> (0,3,100.10) -> (3,5,5.50) 78 | Path Weight: 106.70 79 | 2 -> 6: 80 | no path 81 | 2 -> 7: 82 | no path 83 | 2 -> 8: 84 | no path 85 | 3 -> 4: 86 | (3,4,5.50) 87 | Path Weight: 5.50 88 | 3 -> 5: 89 | (3,5,5.50) 90 | Path Weight: 5.50 91 | 3 -> 6: 92 | no path 93 | 3 -> 7: 94 | no path 95 | 3 -> 8: 96 | no path 97 | 4 -> 5: 98 | (4,5,5.50) 99 | Path Weight: 5.50 100 | 4 -> 6: 101 | no path 102 | 4 -> 7: 103 | no path 104 | 4 -> 8: 105 | no path 106 | 5 -> 6: 107 | no path 108 | 5 -> 7: 109 | no path 110 | 5 -> 8: 111 | no path 112 | 6 -> 7: 113 | (6,7,30.10) 114 | Path Weight: 30.10 115 | 6 -> 8: 116 | (6,8,40.10) 117 | Path Weight: 40.10 118 | 7 -> 8: 119 | (7,8,50.10) 120 | Path Weight: 50.10 121 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output009.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 4, 22.000) 3 | (0, 5, 13.000) 4 | (1, 8, 4.800) 5 | (1, 9, 15.200) 6 | (1, 2, 7.500) 7 | (1, 4, 8.100) 8 | (1, 5, 1.000) 9 | (2, 8, 4.700) 10 | (2, 10, 48.300) 11 | (2, 5, 3.200) 12 | (3, 5, 6.000) 13 | (4, 5, 9.000) 14 | (6, 8, 4.200) 15 | (6, 7, 12.300) 16 | (7, 8, 3.300) 17 | (10, 11, 12.200) 18 | 19 | Depth First Traversal (vertex visited order): 20 | [0, 4, 1, 2, 5, 3, 8, 6, 7, 10, 11, 9] 21 | 22 | Breadth First Traversal (lowest-weight-next): 23 | [0, 5, 4, 1, 2, 3, 8, 9, 10, 7, 6, 11] 24 | 25 | Minimum Spanning Tree: 26 | (0, 5, 13.000) 27 | (1, 9, 15.200) 28 | (1, 4, 8.100) 29 | (1, 5, 1.000) 30 | (2, 8, 4.700) 31 | (2, 10, 48.300) 32 | (2, 5, 3.200) 33 | (3, 5, 6.000) 34 | (6, 8, 4.200) 35 | (7, 8, 3.300) 36 | (10, 11, 12.200) 37 | Type: Full Spanning Tree 38 | Total Weight: 119.200 39 | 40 | Shortest Paths: 41 | 0 -> 1: 42 | (0,5,13.00) -> (5,1,1.00) 43 | Path Weight: 14.00 44 | 0 -> 2: 45 | (0,5,13.00) -> (5,2,3.20) 46 | Path Weight: 16.20 47 | 0 -> 3: 48 | (0,5,13.00) -> (5,3,6.00) 49 | Path Weight: 19.00 50 | 0 -> 4: 51 | (0,4,22.00) 52 | Path Weight: 22.00 53 | 0 -> 5: 54 | (0,5,13.00) 55 | Path Weight: 13.00 56 | 0 -> 6: 57 | (0,5,13.00) -> (5,1,1.00) -> (1,8,4.80) -> (8,6,4.20) 58 | Path Weight: 23.00 59 | 0 -> 7: 60 | (0,5,13.00) -> (5,1,1.00) -> (1,8,4.80) -> (8,7,3.30) 61 | Path Weight: 22.10 62 | 0 -> 8: 63 | (0,5,13.00) -> (5,1,1.00) -> (1,8,4.80) 64 | Path Weight: 18.80 65 | 0 -> 9: 66 | (0,5,13.00) -> (5,1,1.00) -> (1,9,15.20) 67 | Path Weight: 29.20 68 | 0 -> 10: 69 | (0,5,13.00) -> (5,2,3.20) -> (2,10,48.30) 70 | Path Weight: 64.50 71 | 0 -> 11: 72 | (0,5,13.00) -> (5,2,3.20) -> (2,10,48.30) -> (10,11,12.20) 73 | Path Weight: 76.70 74 | 1 -> 2: 75 | (1,5,1.00) -> (5,2,3.20) 76 | Path Weight: 4.20 77 | 1 -> 3: 78 | (1,5,1.00) -> (5,3,6.00) 79 | Path Weight: 7.00 80 | 1 -> 4: 81 | (1,4,8.10) 82 | Path Weight: 8.10 83 | 1 -> 5: 84 | (1,5,1.00) 85 | Path Weight: 1.00 86 | 1 -> 6: 87 | (1,8,4.80) -> (8,6,4.20) 88 | Path Weight: 9.00 89 | 1 -> 7: 90 | (1,8,4.80) -> (8,7,3.30) 91 | Path Weight: 8.10 92 | 1 -> 8: 93 | (1,8,4.80) 94 | Path Weight: 4.80 95 | 1 -> 9: 96 | (1,9,15.20) 97 | Path Weight: 15.20 98 | 1 -> 10: 99 | (1,5,1.00) -> (5,2,3.20) -> (2,10,48.30) 100 | Path Weight: 52.50 101 | 1 -> 11: 102 | (1,5,1.00) -> (5,2,3.20) -> (2,10,48.30) -> (10,11,12.20) 103 | Path Weight: 64.70 104 | 2 -> 3: 105 | (2,5,3.20) -> (5,3,6.00) 106 | Path Weight: 9.20 107 | 2 -> 4: 108 | (2,5,3.20) -> (5,4,9.00) 109 | Path Weight: 12.20 110 | 2 -> 5: 111 | (2,5,3.20) 112 | Path Weight: 3.20 113 | 2 -> 6: 114 | (2,8,4.70) -> (8,6,4.20) 115 | Path Weight: 8.90 116 | 2 -> 7: 117 | (2,8,4.70) -> (8,7,3.30) 118 | Path Weight: 8.00 119 | 2 -> 8: 120 | (2,8,4.70) 121 | Path Weight: 4.70 122 | 2 -> 9: 123 | (2,5,3.20) -> (5,1,1.00) -> (1,9,15.20) 124 | Path Weight: 19.40 125 | 2 -> 10: 126 | (2,10,48.30) 127 | Path Weight: 48.30 128 | 2 -> 11: 129 | (2,10,48.30) -> (10,11,12.20) 130 | Path Weight: 60.50 131 | 3 -> 4: 132 | (3,5,6.00) -> (5,4,9.00) 133 | Path Weight: 15.00 134 | 3 -> 5: 135 | (3,5,6.00) 136 | Path Weight: 6.00 137 | 3 -> 6: 138 | (3,5,6.00) -> (5,1,1.00) -> (1,8,4.80) -> (8,6,4.20) 139 | Path Weight: 16.00 140 | 3 -> 7: 141 | (3,5,6.00) -> (5,1,1.00) -> (1,8,4.80) -> (8,7,3.30) 142 | Path Weight: 15.10 143 | 3 -> 8: 144 | (3,5,6.00) -> (5,1,1.00) -> (1,8,4.80) 145 | Path Weight: 11.80 146 | 3 -> 9: 147 | (3,5,6.00) -> (5,1,1.00) -> (1,9,15.20) 148 | Path Weight: 22.20 149 | 3 -> 10: 150 | (3,5,6.00) -> (5,2,3.20) -> (2,10,48.30) 151 | Path Weight: 57.50 152 | 3 -> 11: 153 | (3,5,6.00) -> (5,2,3.20) -> (2,10,48.30) -> (10,11,12.20) 154 | Path Weight: 69.70 155 | 4 -> 5: 156 | (4,5,9.00) 157 | Path Weight: 9.00 158 | 4 -> 6: 159 | (4,1,8.10) -> (1,8,4.80) -> (8,6,4.20) 160 | Path Weight: 17.10 161 | 4 -> 7: 162 | (4,1,8.10) -> (1,8,4.80) -> (8,7,3.30) 163 | Path Weight: 16.20 164 | 4 -> 8: 165 | (4,1,8.10) -> (1,8,4.80) 166 | Path Weight: 12.90 167 | 4 -> 9: 168 | (4,1,8.10) -> (1,9,15.20) 169 | Path Weight: 23.30 170 | 4 -> 10: 171 | (4,5,9.00) -> (5,2,3.20) -> (2,10,48.30) 172 | Path Weight: 60.50 173 | 4 -> 11: 174 | (4,5,9.00) -> (5,2,3.20) -> (2,10,48.30) -> (10,11,12.20) 175 | Path Weight: 72.70 176 | 5 -> 6: 177 | (5,1,1.00) -> (1,8,4.80) -> (8,6,4.20) 178 | Path Weight: 10.00 179 | 5 -> 7: 180 | (5,1,1.00) -> (1,8,4.80) -> (8,7,3.30) 181 | Path Weight: 9.10 182 | 5 -> 8: 183 | (5,1,1.00) -> (1,8,4.80) 184 | Path Weight: 5.80 185 | 5 -> 9: 186 | (5,1,1.00) -> (1,9,15.20) 187 | Path Weight: 16.20 188 | 5 -> 10: 189 | (5,2,3.20) -> (2,10,48.30) 190 | Path Weight: 51.50 191 | 5 -> 11: 192 | (5,2,3.20) -> (2,10,48.30) -> (10,11,12.20) 193 | Path Weight: 63.70 194 | 6 -> 7: 195 | (6,8,4.20) -> (8,7,3.30) 196 | Path Weight: 7.50 197 | 6 -> 8: 198 | (6,8,4.20) 199 | Path Weight: 4.20 200 | 6 -> 9: 201 | (6,8,4.20) -> (8,1,4.80) -> (1,9,15.20) 202 | Path Weight: 24.20 203 | 6 -> 10: 204 | (6,8,4.20) -> (8,2,4.70) -> (2,10,48.30) 205 | Path Weight: 57.20 206 | 6 -> 11: 207 | (6,8,4.20) -> (8,2,4.70) -> (2,10,48.30) -> (10,11,12.20) 208 | Path Weight: 69.40 209 | 7 -> 8: 210 | (7,8,3.30) 211 | Path Weight: 3.30 212 | 7 -> 9: 213 | (7,8,3.30) -> (8,1,4.80) -> (1,9,15.20) 214 | Path Weight: 23.30 215 | 7 -> 10: 216 | (7,8,3.30) -> (8,2,4.70) -> (2,10,48.30) 217 | Path Weight: 56.30 218 | 7 -> 11: 219 | (7,8,3.30) -> (8,2,4.70) -> (2,10,48.30) -> (10,11,12.20) 220 | Path Weight: 68.50 221 | 8 -> 9: 222 | (8,1,4.80) -> (1,9,15.20) 223 | Path Weight: 20.00 224 | 8 -> 10: 225 | (8,2,4.70) -> (2,10,48.30) 226 | Path Weight: 53.00 227 | 8 -> 11: 228 | (8,2,4.70) -> (2,10,48.30) -> (10,11,12.20) 229 | Path Weight: 65.20 230 | 9 -> 10: 231 | (9,1,15.20) -> (1,5,1.00) -> (5,2,3.20) -> (2,10,48.30) 232 | Path Weight: 67.70 233 | 9 -> 11: 234 | (9,1,15.20) -> (1,5,1.00) -> (5,2,3.20) -> (2,10,48.30) -> (10,11,12.20) 235 | Path Weight: 79.90 236 | 10 -> 11: 237 | (10,11,12.20) 238 | Path Weight: 12.20 239 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output010.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 53.000) 3 | (0, 2, 40.000) 4 | (0, 3, 31.000) 5 | (1, 2, 41.400) 6 | (1, 3, 35.000) 7 | (2, 3, 49.000) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 1, 2, 3] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 3, 2, 1] 14 | 15 | Minimum Spanning Tree: 16 | (0, 2, 40.000) 17 | (0, 3, 31.000) 18 | (1, 3, 35.000) 19 | Type: Full Spanning Tree 20 | Total Weight: 106.000 21 | 22 | Shortest Paths: 23 | 0 -> 1: 24 | (0,1,53.00) 25 | Path Weight: 53.00 26 | 0 -> 2: 27 | (0,2,40.00) 28 | Path Weight: 40.00 29 | 0 -> 3: 30 | (0,3,31.00) 31 | Path Weight: 31.00 32 | 1 -> 2: 33 | (1,2,41.40) 34 | Path Weight: 41.40 35 | 1 -> 3: 36 | (1,3,35.00) 37 | Path Weight: 35.00 38 | 2 -> 3: 39 | (2,3,49.00) 40 | Path Weight: 49.00 41 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output011.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 2, 3.000) 3 | (0, 3, 2.100) 4 | (0, 4, 4.300) 5 | (1, 2, 3.140) 6 | (1, 3, 2.500) 7 | (2, 3, 3.900) 8 | (2, 4, 10.300) 9 | 10 | Depth First Traversal (vertex visited order): 11 | [0, 2, 1, 3, 4] 12 | 13 | Breadth First Traversal (lowest-weight-next): 14 | [0, 3, 2, 4, 1] 15 | 16 | Minimum Spanning Tree: 17 | (0, 2, 3.000) 18 | (0, 3, 2.100) 19 | (0, 4, 4.300) 20 | (1, 3, 2.500) 21 | Type: Full Spanning Tree 22 | Total Weight: 11.900 23 | 24 | Shortest Paths: 25 | 0 -> 1: 26 | (0,3,2.10) -> (3,1,2.50) 27 | Path Weight: 4.60 28 | 0 -> 2: 29 | (0,2,3.00) 30 | Path Weight: 3.00 31 | 0 -> 3: 32 | (0,3,2.10) 33 | Path Weight: 2.10 34 | 0 -> 4: 35 | (0,4,4.30) 36 | Path Weight: 4.30 37 | 1 -> 2: 38 | (1,2,3.14) 39 | Path Weight: 3.14 40 | 1 -> 3: 41 | (1,3,2.50) 42 | Path Weight: 2.50 43 | 1 -> 4: 44 | (1,3,2.50) -> (3,0,2.10) -> (0,4,4.30) 45 | Path Weight: 8.90 46 | 2 -> 3: 47 | (2,3,3.90) 48 | Path Weight: 3.90 49 | 2 -> 4: 50 | (2,0,3.00) -> (0,4,4.30) 51 | Path Weight: 7.30 52 | 3 -> 4: 53 | (3,0,2.10) -> (0,4,4.30) 54 | Path Weight: 6.40 55 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output012.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 2, 3.000) 3 | (0, 3, 2.100) 4 | (0, 4, 4.300) 5 | (1, 2, 3.140) 6 | (1, 3, 2.500) 7 | (2, 3, 3.900) 8 | (2, 4, 15.000) 9 | 10 | Depth First Traversal (vertex visited order): 11 | [0, 2, 1, 3, 4] 12 | 13 | Breadth First Traversal (lowest-weight-next): 14 | [0, 3, 2, 4, 1] 15 | 16 | Minimum Spanning Tree: 17 | (0, 2, 3.000) 18 | (0, 3, 2.100) 19 | (0, 4, 4.300) 20 | (1, 3, 2.500) 21 | Type: Full Spanning Tree 22 | Total Weight: 11.900 23 | 24 | Shortest Paths: 25 | 0 -> 1: 26 | (0,3,2.10) -> (3,1,2.50) 27 | Path Weight: 4.60 28 | 0 -> 2: 29 | (0,2,3.00) 30 | Path Weight: 3.00 31 | 0 -> 3: 32 | (0,3,2.10) 33 | Path Weight: 2.10 34 | 0 -> 4: 35 | (0,4,4.30) 36 | Path Weight: 4.30 37 | 1 -> 2: 38 | (1,2,3.14) 39 | Path Weight: 3.14 40 | 1 -> 3: 41 | (1,3,2.50) 42 | Path Weight: 2.50 43 | 1 -> 4: 44 | (1,3,2.50) -> (3,0,2.10) -> (0,4,4.30) 45 | Path Weight: 8.90 46 | 2 -> 3: 47 | (2,3,3.90) 48 | Path Weight: 3.90 49 | 2 -> 4: 50 | (2,0,3.00) -> (0,4,4.30) 51 | Path Weight: 7.30 52 | 3 -> 4: 53 | (3,0,2.10) -> (0,4,4.30) 54 | Path Weight: 6.40 55 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output013.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 2, 3.000) 3 | (0, 3, 2.100) 4 | (1, 2, 3.140) 5 | (1, 3, 2.500) 6 | (2, 3, 3.900) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 2, 1, 3] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 3, 2, 1] 13 | 14 | Minimum Spanning Tree: 15 | (0, 2, 3.000) 16 | (0, 3, 2.100) 17 | (1, 3, 2.500) 18 | Type: Full Spanning Tree 19 | Total Weight: 7.600 20 | 21 | Shortest Paths: 22 | 0 -> 1: 23 | (0,3,2.10) -> (3,1,2.50) 24 | Path Weight: 4.60 25 | 0 -> 2: 26 | (0,2,3.00) 27 | Path Weight: 3.00 28 | 0 -> 3: 29 | (0,3,2.10) 30 | Path Weight: 2.10 31 | 1 -> 2: 32 | (1,2,3.14) 33 | Path Weight: 3.14 34 | 1 -> 3: 35 | (1,3,2.50) 36 | Path Weight: 2.50 37 | 2 -> 3: 38 | (2,3,3.90) 39 | Path Weight: 3.90 40 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output014.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 2, 3.000) 3 | (1, 2, 3.140) 4 | 5 | Depth First Traversal (vertex visited order): 6 | [0, 2, 1] 7 | 8 | Breadth First Traversal (lowest-weight-next): 9 | [0, 2, 1] 10 | 11 | Minimum Spanning Tree: 12 | (0, 2, 3.000) 13 | (1, 2, 3.140) 14 | Type: Full Spanning Tree 15 | Total Weight: 6.140 16 | 17 | Shortest Paths: 18 | 0 -> 1: 19 | (0,2,3.00) -> (2,1,3.14) 20 | Path Weight: 6.14 21 | 0 -> 2: 22 | (0,2,3.00) 23 | Path Weight: 3.00 24 | 1 -> 2: 25 | (1,2,3.14) 26 | Path Weight: 3.14 27 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output015.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 5.000) 3 | (0, 2, 1.000) 4 | (1, 3, 7.000) 5 | (1, 4, 2.000) 6 | (2, 3, 3.000) 7 | (3, 4, 4.000) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 1, 3, 2, 4] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 2, 1, 3, 4] 14 | 15 | Minimum Spanning Tree: 16 | (0, 2, 1.000) 17 | (1, 4, 2.000) 18 | (2, 3, 3.000) 19 | (3, 4, 4.000) 20 | Type: Full Spanning Tree 21 | Total Weight: 10.000 22 | 23 | Shortest Paths: 24 | 0 -> 1: 25 | (0,1,5.00) 26 | Path Weight: 5.00 27 | 0 -> 2: 28 | (0,2,1.00) 29 | Path Weight: 1.00 30 | 0 -> 3: 31 | (0,2,1.00) -> (2,3,3.00) 32 | Path Weight: 4.00 33 | 0 -> 4: 34 | (0,1,5.00) -> (1,4,2.00) 35 | Path Weight: 7.00 36 | 1 -> 2: 37 | (1,0,5.00) -> (0,2,1.00) 38 | Path Weight: 6.00 39 | 1 -> 3: 40 | (1,4,2.00) -> (4,3,4.00) 41 | Path Weight: 6.00 42 | 1 -> 4: 43 | (1,4,2.00) 44 | Path Weight: 2.00 45 | 2 -> 3: 46 | (2,3,3.00) 47 | Path Weight: 3.00 48 | 2 -> 4: 49 | (2,3,3.00) -> (3,4,4.00) 50 | Path Weight: 7.00 51 | 3 -> 4: 52 | (3,4,4.00) 53 | Path Weight: 4.00 54 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output016.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 2.700) 3 | (0, 3, 3.300) 4 | (1, 4, 7.100) 5 | (2, 4, 4.450) 6 | (2, 5, 6.800) 7 | (3, 4, 1.260) 8 | (4, 5, 5.590) 9 | 10 | Depth First Traversal (vertex visited order): 11 | [0, 1, 4, 2, 5, 3] 12 | 13 | Breadth First Traversal (lowest-weight-next): 14 | [0, 1, 3, 4, 2, 5] 15 | 16 | Minimum Spanning Tree: 17 | (0, 1, 2.700) 18 | (0, 3, 3.300) 19 | (2, 4, 4.450) 20 | (3, 4, 1.260) 21 | (4, 5, 5.590) 22 | Type: Full Spanning Tree 23 | Total Weight: 17.300 24 | 25 | Shortest Paths: 26 | 0 -> 1: 27 | (0,1,2.70) 28 | Path Weight: 2.70 29 | 0 -> 2: 30 | (0,3,3.30) -> (3,4,1.26) -> (4,2,4.45) 31 | Path Weight: 9.01 32 | 0 -> 3: 33 | (0,3,3.30) 34 | Path Weight: 3.30 35 | 0 -> 4: 36 | (0,3,3.30) -> (3,4,1.26) 37 | Path Weight: 4.56 38 | 0 -> 5: 39 | (0,3,3.30) -> (3,4,1.26) -> (4,5,5.59) 40 | Path Weight: 10.15 41 | 1 -> 2: 42 | (1,4,7.10) -> (4,2,4.45) 43 | Path Weight: 11.55 44 | 1 -> 3: 45 | (1,0,2.70) -> (0,3,3.30) 46 | Path Weight: 6.00 47 | 1 -> 4: 48 | (1,4,7.10) 49 | Path Weight: 7.10 50 | 1 -> 5: 51 | (1,4,7.10) -> (4,5,5.59) 52 | Path Weight: 12.69 53 | 2 -> 3: 54 | (2,4,4.45) -> (4,3,1.26) 55 | Path Weight: 5.71 56 | 2 -> 4: 57 | (2,4,4.45) 58 | Path Weight: 4.45 59 | 2 -> 5: 60 | (2,5,6.80) 61 | Path Weight: 6.80 62 | 3 -> 4: 63 | (3,4,1.26) 64 | Path Weight: 1.26 65 | 3 -> 5: 66 | (3,4,1.26) -> (4,5,5.59) 67 | Path Weight: 6.85 68 | 4 -> 5: 69 | (4,5,5.59) 70 | Path Weight: 5.59 71 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output017.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 1.000) 3 | (0, 2, 2.000) 4 | (1, 2, 4.000) 5 | (3, 4, 3.000) 6 | (3, 5, 5.000) 7 | (3, 6, 2.000) 8 | (4, 5, 4.000) 9 | (5, 6, 2.000) 10 | 11 | Depth First Traversal (vertex visited order): 12 | [0, 1, 2, 3, 4, 5, 6] 13 | 14 | Breadth First Traversal (lowest-weight-next): 15 | [0, 1, 2, 3, 6, 4, 5] 16 | 17 | Minimum Spanning Tree: 18 | (0, 1, 1.000) 19 | (0, 2, 2.000) 20 | (3, 4, 3.000) 21 | (3, 6, 2.000) 22 | (5, 6, 2.000) 23 | Type: Spanning Forrest 24 | Total Weight: 10.000 25 | 26 | Shortest Paths: 27 | 0 -> 1: 28 | (0,1,1.00) 29 | Path Weight: 1.00 30 | 0 -> 2: 31 | (0,2,2.00) 32 | Path Weight: 2.00 33 | 0 -> 3: 34 | no path 35 | 0 -> 4: 36 | no path 37 | 0 -> 5: 38 | no path 39 | 0 -> 6: 40 | no path 41 | 1 -> 2: 42 | (1,0,1.00) -> (0,2,2.00) 43 | Path Weight: 3.00 44 | 1 -> 3: 45 | no path 46 | 1 -> 4: 47 | no path 48 | 1 -> 5: 49 | no path 50 | 1 -> 6: 51 | no path 52 | 2 -> 3: 53 | no path 54 | 2 -> 4: 55 | no path 56 | 2 -> 5: 57 | no path 58 | 2 -> 6: 59 | no path 60 | 3 -> 4: 61 | (3,4,3.00) 62 | Path Weight: 3.00 63 | 3 -> 5: 64 | (3,6,2.00) -> (6,5,2.00) 65 | Path Weight: 4.00 66 | 3 -> 6: 67 | (3,6,2.00) 68 | Path Weight: 2.00 69 | 4 -> 5: 70 | (4,5,4.00) 71 | Path Weight: 4.00 72 | 4 -> 6: 73 | (4,3,3.00) -> (3,6,2.00) 74 | Path Weight: 5.00 75 | 5 -> 6: 76 | (5,6,2.00) 77 | Path Weight: 2.00 78 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output018.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 5.700) 3 | (0, 4, 7.300) 4 | (0, 6, 2.000) 5 | (1, 4, 5.100) 6 | (1, 6, 3.500) 7 | (2, 3, 8.100) 8 | (2, 4, 7.200) 9 | (2, 5, 6.700) 10 | (3, 4, 3.300) 11 | (3, 5, 4.200) 12 | (4, 5, 9.400) 13 | (4, 6, 2.300) 14 | 15 | Depth First Traversal (vertex visited order): 16 | [0, 1, 4, 2, 3, 5, 6] 17 | 18 | Breadth First Traversal (lowest-weight-next): 19 | [0, 6, 1, 4, 3, 2, 5] 20 | 21 | Minimum Spanning Tree: 22 | (0, 6, 2.000) 23 | (1, 6, 3.500) 24 | (2, 5, 6.700) 25 | (3, 4, 3.300) 26 | (3, 5, 4.200) 27 | (4, 6, 2.300) 28 | Type: Full Spanning Tree 29 | Total Weight: 22.000 30 | 31 | Shortest Paths: 32 | 0 -> 1: 33 | (0,6,2.00) -> (6,1,3.50) 34 | Path Weight: 5.50 35 | 0 -> 2: 36 | (0,6,2.00) -> (6,4,2.30) -> (4,2,7.20) 37 | Path Weight: 11.50 38 | 0 -> 3: 39 | (0,6,2.00) -> (6,4,2.30) -> (4,3,3.30) 40 | Path Weight: 7.60 41 | 0 -> 4: 42 | (0,6,2.00) -> (6,4,2.30) 43 | Path Weight: 4.30 44 | 0 -> 5: 45 | (0,6,2.00) -> (6,4,2.30) -> (4,3,3.30) -> (3,5,4.20) 46 | Path Weight: 11.80 47 | 0 -> 6: 48 | (0,6,2.00) 49 | Path Weight: 2.00 50 | 1 -> 2: 51 | (1,4,5.10) -> (4,2,7.20) 52 | Path Weight: 12.30 53 | 1 -> 3: 54 | (1,4,5.10) -> (4,3,3.30) 55 | Path Weight: 8.40 56 | 1 -> 4: 57 | (1,4,5.10) 58 | Path Weight: 5.10 59 | 1 -> 5: 60 | (1,4,5.10) -> (4,3,3.30) -> (3,5,4.20) 61 | Path Weight: 12.60 62 | 1 -> 6: 63 | (1,6,3.50) 64 | Path Weight: 3.50 65 | 2 -> 3: 66 | (2,3,8.10) 67 | Path Weight: 8.10 68 | 2 -> 4: 69 | (2,4,7.20) 70 | Path Weight: 7.20 71 | 2 -> 5: 72 | (2,5,6.70) 73 | Path Weight: 6.70 74 | 2 -> 6: 75 | (2,4,7.20) -> (4,6,2.30) 76 | Path Weight: 9.50 77 | 3 -> 4: 78 | (3,4,3.30) 79 | Path Weight: 3.30 80 | 3 -> 5: 81 | (3,5,4.20) 82 | Path Weight: 4.20 83 | 3 -> 6: 84 | (3,4,3.30) -> (4,6,2.30) 85 | Path Weight: 5.60 86 | 4 -> 5: 87 | (4,3,3.30) -> (3,5,4.20) 88 | Path Weight: 7.50 89 | 4 -> 6: 90 | (4,6,2.30) 91 | Path Weight: 2.30 92 | 5 -> 6: 93 | (5,3,4.20) -> (3,4,3.30) -> (4,6,2.30) 94 | Path Weight: 9.80 95 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output019.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 50.000) 3 | (0, 5, 20.000) 4 | (1, 5, 18.000) 5 | (2, 4, 30.000) 6 | (2, 5, 12.500) 7 | (3, 5, 25.000) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 1, 5, 2, 4, 3] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 5, 1, 2, 3, 4] 14 | 15 | Minimum Spanning Tree: 16 | (0, 5, 20.000) 17 | (1, 5, 18.000) 18 | (2, 4, 30.000) 19 | (2, 5, 12.500) 20 | (3, 5, 25.000) 21 | Type: Full Spanning Tree 22 | Total Weight: 105.500 23 | 24 | Shortest Paths: 25 | 0 -> 1: 26 | (0,5,20.00) -> (5,1,18.00) 27 | Path Weight: 38.00 28 | 0 -> 2: 29 | (0,5,20.00) -> (5,2,12.50) 30 | Path Weight: 32.50 31 | 0 -> 3: 32 | (0,5,20.00) -> (5,3,25.00) 33 | Path Weight: 45.00 34 | 0 -> 4: 35 | (0,5,20.00) -> (5,2,12.50) -> (2,4,30.00) 36 | Path Weight: 62.50 37 | 0 -> 5: 38 | (0,5,20.00) 39 | Path Weight: 20.00 40 | 1 -> 2: 41 | (1,5,18.00) -> (5,2,12.50) 42 | Path Weight: 30.50 43 | 1 -> 3: 44 | (1,5,18.00) -> (5,3,25.00) 45 | Path Weight: 43.00 46 | 1 -> 4: 47 | (1,5,18.00) -> (5,2,12.50) -> (2,4,30.00) 48 | Path Weight: 60.50 49 | 1 -> 5: 50 | (1,5,18.00) 51 | Path Weight: 18.00 52 | 2 -> 3: 53 | (2,5,12.50) -> (5,3,25.00) 54 | Path Weight: 37.50 55 | 2 -> 4: 56 | (2,4,30.00) 57 | Path Weight: 30.00 58 | 2 -> 5: 59 | (2,5,12.50) 60 | Path Weight: 12.50 61 | 3 -> 4: 62 | (3,5,25.00) -> (5,2,12.50) -> (2,4,30.00) 63 | Path Weight: 67.50 64 | 3 -> 5: 65 | (3,5,25.00) 66 | Path Weight: 25.00 67 | 4 -> 5: 68 | (4,2,30.00) -> (2,5,12.50) 69 | Path Weight: 42.50 70 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output020.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 2.000) 3 | (1, 2, 4.000) 4 | (2, 3, 6.000) 5 | (3, 4, 8.000) 6 | (4, 9, 12.000) 7 | (4, 5, 10.000) 8 | (5, 6, 14.000) 9 | (7, 8, 30.000) 10 | 11 | Depth First Traversal (vertex visited order): 12 | [0, 1, 2, 3, 4, 5, 6, 9, 7, 8] 13 | 14 | Breadth First Traversal (lowest-weight-next): 15 | [0, 1, 2, 3, 4, 5, 9, 6, 7, 8] 16 | 17 | Minimum Spanning Tree: 18 | (0, 1, 2.000) 19 | (1, 2, 4.000) 20 | (2, 3, 6.000) 21 | (3, 4, 8.000) 22 | (4, 9, 12.000) 23 | (4, 5, 10.000) 24 | (5, 6, 14.000) 25 | (7, 8, 30.000) 26 | Type: Spanning Forrest 27 | Total Weight: 86.000 28 | 29 | Shortest Paths: 30 | 0 -> 1: 31 | (0,1,2.00) 32 | Path Weight: 2.00 33 | 0 -> 2: 34 | (0,1,2.00) -> (1,2,4.00) 35 | Path Weight: 6.00 36 | 0 -> 3: 37 | (0,1,2.00) -> (1,2,4.00) -> (2,3,6.00) 38 | Path Weight: 12.00 39 | 0 -> 4: 40 | (0,1,2.00) -> (1,2,4.00) -> (2,3,6.00) -> (3,4,8.00) 41 | Path Weight: 20.00 42 | 0 -> 5: 43 | (0,1,2.00) -> (1,2,4.00) -> (2,3,6.00) -> (3,4,8.00) -> (4,5,10.00) 44 | Path Weight: 30.00 45 | 0 -> 6: 46 | (0,1,2.00) -> (1,2,4.00) -> (2,3,6.00) -> (3,4,8.00) -> (4,5,10.00) -> (5,6,14.00) 47 | Path Weight: 44.00 48 | 0 -> 7: 49 | no path 50 | 0 -> 8: 51 | no path 52 | 0 -> 9: 53 | (0,1,2.00) -> (1,2,4.00) -> (2,3,6.00) -> (3,4,8.00) -> (4,9,12.00) 54 | Path Weight: 32.00 55 | 1 -> 2: 56 | (1,2,4.00) 57 | Path Weight: 4.00 58 | 1 -> 3: 59 | (1,2,4.00) -> (2,3,6.00) 60 | Path Weight: 10.00 61 | 1 -> 4: 62 | (1,2,4.00) -> (2,3,6.00) -> (3,4,8.00) 63 | Path Weight: 18.00 64 | 1 -> 5: 65 | (1,2,4.00) -> (2,3,6.00) -> (3,4,8.00) -> (4,5,10.00) 66 | Path Weight: 28.00 67 | 1 -> 6: 68 | (1,2,4.00) -> (2,3,6.00) -> (3,4,8.00) -> (4,5,10.00) -> (5,6,14.00) 69 | Path Weight: 42.00 70 | 1 -> 7: 71 | no path 72 | 1 -> 8: 73 | no path 74 | 1 -> 9: 75 | (1,2,4.00) -> (2,3,6.00) -> (3,4,8.00) -> (4,9,12.00) 76 | Path Weight: 30.00 77 | 2 -> 3: 78 | (2,3,6.00) 79 | Path Weight: 6.00 80 | 2 -> 4: 81 | (2,3,6.00) -> (3,4,8.00) 82 | Path Weight: 14.00 83 | 2 -> 5: 84 | (2,3,6.00) -> (3,4,8.00) -> (4,5,10.00) 85 | Path Weight: 24.00 86 | 2 -> 6: 87 | (2,3,6.00) -> (3,4,8.00) -> (4,5,10.00) -> (5,6,14.00) 88 | Path Weight: 38.00 89 | 2 -> 7: 90 | no path 91 | 2 -> 8: 92 | no path 93 | 2 -> 9: 94 | (2,3,6.00) -> (3,4,8.00) -> (4,9,12.00) 95 | Path Weight: 26.00 96 | 3 -> 4: 97 | (3,4,8.00) 98 | Path Weight: 8.00 99 | 3 -> 5: 100 | (3,4,8.00) -> (4,5,10.00) 101 | Path Weight: 18.00 102 | 3 -> 6: 103 | (3,4,8.00) -> (4,5,10.00) -> (5,6,14.00) 104 | Path Weight: 32.00 105 | 3 -> 7: 106 | no path 107 | 3 -> 8: 108 | no path 109 | 3 -> 9: 110 | (3,4,8.00) -> (4,9,12.00) 111 | Path Weight: 20.00 112 | 4 -> 5: 113 | (4,5,10.00) 114 | Path Weight: 10.00 115 | 4 -> 6: 116 | (4,5,10.00) -> (5,6,14.00) 117 | Path Weight: 24.00 118 | 4 -> 7: 119 | no path 120 | 4 -> 8: 121 | no path 122 | 4 -> 9: 123 | (4,9,12.00) 124 | Path Weight: 12.00 125 | 5 -> 6: 126 | (5,6,14.00) 127 | Path Weight: 14.00 128 | 5 -> 7: 129 | no path 130 | 5 -> 8: 131 | no path 132 | 5 -> 9: 133 | (5,4,10.00) -> (4,9,12.00) 134 | Path Weight: 22.00 135 | 6 -> 7: 136 | no path 137 | 6 -> 8: 138 | no path 139 | 6 -> 9: 140 | (6,5,14.00) -> (5,4,10.00) -> (4,9,12.00) 141 | Path Weight: 36.00 142 | 7 -> 8: 143 | (7,8,30.00) 144 | Path Weight: 30.00 145 | 7 -> 9: 146 | no path 147 | 8 -> 9: 148 | no path 149 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output021.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 0.500) 3 | (0, 2, 4.000) 4 | (1, 8, 2.220) 5 | (1, 4, 1.110) 6 | (1, 5, 7.050) 7 | (1, 6, 1.220) 8 | (2, 3, 2.100) 9 | (3, 8, 3.100) 10 | (4, 5, 2.500) 11 | (4, 7, 3.700) 12 | 13 | Depth First Traversal (vertex visited order): 14 | [0, 1, 4, 5, 7, 6, 8, 3, 2] 15 | 16 | Breadth First Traversal (lowest-weight-next): 17 | [0, 1, 2, 4, 6, 8, 5, 3, 7] 18 | 19 | Minimum Spanning Tree: 20 | (0, 1, 0.500) 21 | (1, 8, 2.220) 22 | (1, 4, 1.110) 23 | (1, 6, 1.220) 24 | (2, 3, 2.100) 25 | (3, 8, 3.100) 26 | (4, 5, 2.500) 27 | (4, 7, 3.700) 28 | Type: Full Spanning Tree 29 | Total Weight: 16.450 30 | 31 | Shortest Paths: 32 | 0 -> 1: 33 | (0,1,0.50) 34 | Path Weight: 0.50 35 | 0 -> 2: 36 | (0,2,4.00) 37 | Path Weight: 4.00 38 | 0 -> 3: 39 | (0,1,0.50) -> (1,8,2.22) -> (8,3,3.10) 40 | Path Weight: 5.82 41 | 0 -> 4: 42 | (0,1,0.50) -> (1,4,1.11) 43 | Path Weight: 1.61 44 | 0 -> 5: 45 | (0,1,0.50) -> (1,4,1.11) -> (4,5,2.50) 46 | Path Weight: 4.11 47 | 0 -> 6: 48 | (0,1,0.50) -> (1,6,1.22) 49 | Path Weight: 1.72 50 | 0 -> 7: 51 | (0,1,0.50) -> (1,4,1.11) -> (4,7,3.70) 52 | Path Weight: 5.31 53 | 0 -> 8: 54 | (0,1,0.50) -> (1,8,2.22) 55 | Path Weight: 2.72 56 | 1 -> 2: 57 | (1,0,0.50) -> (0,2,4.00) 58 | Path Weight: 4.50 59 | 1 -> 3: 60 | (1,8,2.22) -> (8,3,3.10) 61 | Path Weight: 5.32 62 | 1 -> 4: 63 | (1,4,1.11) 64 | Path Weight: 1.11 65 | 1 -> 5: 66 | (1,4,1.11) -> (4,5,2.50) 67 | Path Weight: 3.61 68 | 1 -> 6: 69 | (1,6,1.22) 70 | Path Weight: 1.22 71 | 1 -> 7: 72 | (1,4,1.11) -> (4,7,3.70) 73 | Path Weight: 4.81 74 | 1 -> 8: 75 | (1,8,2.22) 76 | Path Weight: 2.22 77 | 2 -> 3: 78 | (2,3,2.10) 79 | Path Weight: 2.10 80 | 2 -> 4: 81 | (2,0,4.00) -> (0,1,0.50) -> (1,4,1.11) 82 | Path Weight: 5.61 83 | 2 -> 5: 84 | (2,0,4.00) -> (0,1,0.50) -> (1,4,1.11) -> (4,5,2.50) 85 | Path Weight: 8.11 86 | 2 -> 6: 87 | (2,0,4.00) -> (0,1,0.50) -> (1,6,1.22) 88 | Path Weight: 5.72 89 | 2 -> 7: 90 | (2,0,4.00) -> (0,1,0.50) -> (1,4,1.11) -> (4,7,3.70) 91 | Path Weight: 9.31 92 | 2 -> 8: 93 | (2,3,2.10) -> (3,8,3.10) 94 | Path Weight: 5.20 95 | 3 -> 4: 96 | (3,8,3.10) -> (8,1,2.22) -> (1,4,1.11) 97 | Path Weight: 6.43 98 | 3 -> 5: 99 | (3,8,3.10) -> (8,1,2.22) -> (1,4,1.11) -> (4,5,2.50) 100 | Path Weight: 8.93 101 | 3 -> 6: 102 | (3,8,3.10) -> (8,1,2.22) -> (1,6,1.22) 103 | Path Weight: 6.54 104 | 3 -> 7: 105 | (3,8,3.10) -> (8,1,2.22) -> (1,4,1.11) -> (4,7,3.70) 106 | Path Weight: 10.13 107 | 3 -> 8: 108 | (3,8,3.10) 109 | Path Weight: 3.10 110 | 4 -> 5: 111 | (4,5,2.50) 112 | Path Weight: 2.50 113 | 4 -> 6: 114 | (4,1,1.11) -> (1,6,1.22) 115 | Path Weight: 2.33 116 | 4 -> 7: 117 | (4,7,3.70) 118 | Path Weight: 3.70 119 | 4 -> 8: 120 | (4,1,1.11) -> (1,8,2.22) 121 | Path Weight: 3.33 122 | 5 -> 6: 123 | (5,4,2.50) -> (4,1,1.11) -> (1,6,1.22) 124 | Path Weight: 4.83 125 | 5 -> 7: 126 | (5,4,2.50) -> (4,7,3.70) 127 | Path Weight: 6.20 128 | 5 -> 8: 129 | (5,4,2.50) -> (4,1,1.11) -> (1,8,2.22) 130 | Path Weight: 5.83 131 | 6 -> 7: 132 | (6,1,1.22) -> (1,4,1.11) -> (4,7,3.70) 133 | Path Weight: 6.03 134 | 6 -> 8: 135 | (6,1,1.22) -> (1,8,2.22) 136 | Path Weight: 3.44 137 | 7 -> 8: 138 | (7,4,3.70) -> (4,1,1.11) -> (1,8,2.22) 139 | Path Weight: 7.03 140 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output022.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 0.500) 3 | (0, 2, 2.100) 4 | (1, 3, 3.100) 5 | (1, 5, 7.100) 6 | (2, 3, 1.200) 7 | (2, 4, 0.200) 8 | (4, 5, 1.550) 9 | 10 | Depth First Traversal (vertex visited order): 11 | [0, 1, 3, 2, 4, 5] 12 | 13 | Breadth First Traversal (lowest-weight-next): 14 | [0, 1, 2, 3, 5, 4] 15 | 16 | Minimum Spanning Tree: 17 | (0, 1, 0.500) 18 | (0, 2, 2.100) 19 | (2, 3, 1.200) 20 | (2, 4, 0.200) 21 | (4, 5, 1.550) 22 | Type: Full Spanning Tree 23 | Total Weight: 5.550 24 | 25 | Shortest Paths: 26 | 0 -> 1: 27 | (0,1,0.50) 28 | Path Weight: 0.50 29 | 0 -> 2: 30 | (0,2,2.10) 31 | Path Weight: 2.10 32 | 0 -> 3: 33 | (0,2,2.10) -> (2,3,1.20) 34 | Path Weight: 3.30 35 | 0 -> 4: 36 | (0,2,2.10) -> (2,4,0.20) 37 | Path Weight: 2.30 38 | 0 -> 5: 39 | (0,2,2.10) -> (2,4,0.20) -> (4,5,1.55) 40 | Path Weight: 3.85 41 | 1 -> 2: 42 | (1,0,0.50) -> (0,2,2.10) 43 | Path Weight: 2.60 44 | 1 -> 3: 45 | (1,3,3.10) 46 | Path Weight: 3.10 47 | 1 -> 4: 48 | (1,0,0.50) -> (0,2,2.10) -> (2,4,0.20) 49 | Path Weight: 2.80 50 | 1 -> 5: 51 | (1,0,0.50) -> (0,2,2.10) -> (2,4,0.20) -> (4,5,1.55) 52 | Path Weight: 4.35 53 | 2 -> 3: 54 | (2,3,1.20) 55 | Path Weight: 1.20 56 | 2 -> 4: 57 | (2,4,0.20) 58 | Path Weight: 0.20 59 | 2 -> 5: 60 | (2,4,0.20) -> (4,5,1.55) 61 | Path Weight: 1.75 62 | 3 -> 4: 63 | (3,2,1.20) -> (2,4,0.20) 64 | Path Weight: 1.40 65 | 3 -> 5: 66 | (3,2,1.20) -> (2,4,0.20) -> (4,5,1.55) 67 | Path Weight: 2.95 68 | 4 -> 5: 69 | (4,5,1.55) 70 | Path Weight: 1.55 71 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output023.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 4.000) 3 | (0, 2, 2.000) 4 | (2, 3, 1.000) 5 | 6 | Depth First Traversal (vertex visited order): 7 | [0, 1, 2, 3] 8 | 9 | Breadth First Traversal (lowest-weight-next): 10 | [0, 2, 1, 3] 11 | 12 | Minimum Spanning Tree: 13 | (0, 1, 4.000) 14 | (0, 2, 2.000) 15 | (2, 3, 1.000) 16 | Type: Full Spanning Tree 17 | Total Weight: 7.000 18 | 19 | Shortest Paths: 20 | 0 -> 1: 21 | (0,1,4.00) 22 | Path Weight: 4.00 23 | 0 -> 2: 24 | (0,2,2.00) 25 | Path Weight: 2.00 26 | 0 -> 3: 27 | (0,2,2.00) -> (2,3,1.00) 28 | Path Weight: 3.00 29 | 1 -> 2: 30 | (1,0,4.00) -> (0,2,2.00) 31 | Path Weight: 6.00 32 | 1 -> 3: 33 | (1,0,4.00) -> (0,2,2.00) -> (2,3,1.00) 34 | Path Weight: 7.00 35 | 2 -> 3: 36 | (2,3,1.00) 37 | Path Weight: 1.00 38 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output024.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 1.000) 3 | (0, 2, 2.000) 4 | (1, 3, 5.000) 5 | (2, 4, 6.000) 6 | (2, 5, 4.000) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 1, 3, 2, 4, 5] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 1, 2, 3, 5, 4] 13 | 14 | Minimum Spanning Tree: 15 | (0, 1, 1.000) 16 | (0, 2, 2.000) 17 | (1, 3, 5.000) 18 | (2, 4, 6.000) 19 | (2, 5, 4.000) 20 | Type: Full Spanning Tree 21 | Total Weight: 18.000 22 | 23 | Shortest Paths: 24 | 0 -> 1: 25 | (0,1,1.00) 26 | Path Weight: 1.00 27 | 0 -> 2: 28 | (0,2,2.00) 29 | Path Weight: 2.00 30 | 0 -> 3: 31 | (0,1,1.00) -> (1,3,5.00) 32 | Path Weight: 6.00 33 | 0 -> 4: 34 | (0,2,2.00) -> (2,4,6.00) 35 | Path Weight: 8.00 36 | 0 -> 5: 37 | (0,2,2.00) -> (2,5,4.00) 38 | Path Weight: 6.00 39 | 1 -> 2: 40 | (1,0,1.00) -> (0,2,2.00) 41 | Path Weight: 3.00 42 | 1 -> 3: 43 | (1,3,5.00) 44 | Path Weight: 5.00 45 | 1 -> 4: 46 | (1,0,1.00) -> (0,2,2.00) -> (2,4,6.00) 47 | Path Weight: 9.00 48 | 1 -> 5: 49 | (1,0,1.00) -> (0,2,2.00) -> (2,5,4.00) 50 | Path Weight: 7.00 51 | 2 -> 3: 52 | (2,0,2.00) -> (0,1,1.00) -> (1,3,5.00) 53 | Path Weight: 8.00 54 | 2 -> 4: 55 | (2,4,6.00) 56 | Path Weight: 6.00 57 | 2 -> 5: 58 | (2,5,4.00) 59 | Path Weight: 4.00 60 | 3 -> 4: 61 | (3,1,5.00) -> (1,0,1.00) -> (0,2,2.00) -> (2,4,6.00) 62 | Path Weight: 14.00 63 | 3 -> 5: 64 | (3,1,5.00) -> (1,0,1.00) -> (0,2,2.00) -> (2,5,4.00) 65 | Path Weight: 12.00 66 | 4 -> 5: 67 | (4,2,6.00) -> (2,5,4.00) 68 | Path Weight: 10.00 69 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output025.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 2, 3.000) 3 | (0, 5, 4.000) 4 | (1, 2, 2.000) 5 | (1, 4, 4.100) 6 | (1, 5, 3.100) 7 | (2, 3, 7.000) 8 | (2, 4, 1.300) 9 | (2, 5, 1.100) 10 | (3, 4, 8.000) 11 | 12 | Depth First Traversal (vertex visited order): 13 | [0, 2, 1, 4, 3, 5] 14 | 15 | Breadth First Traversal (lowest-weight-next): 16 | [0, 2, 5, 4, 1, 3] 17 | 18 | Minimum Spanning Tree: 19 | (0, 2, 3.000) 20 | (1, 2, 2.000) 21 | (2, 3, 7.000) 22 | (2, 4, 1.300) 23 | (2, 5, 1.100) 24 | Type: Full Spanning Tree 25 | Total Weight: 14.400 26 | 27 | Shortest Paths: 28 | 0 -> 1: 29 | (0,2,3.00) -> (2,1,2.00) 30 | Path Weight: 5.00 31 | 0 -> 2: 32 | (0,2,3.00) 33 | Path Weight: 3.00 34 | 0 -> 3: 35 | (0,2,3.00) -> (2,3,7.00) 36 | Path Weight: 10.00 37 | 0 -> 4: 38 | (0,2,3.00) -> (2,4,1.30) 39 | Path Weight: 4.30 40 | 0 -> 5: 41 | (0,5,4.00) 42 | Path Weight: 4.00 43 | 1 -> 2: 44 | (1,2,2.00) 45 | Path Weight: 2.00 46 | 1 -> 3: 47 | (1,2,2.00) -> (2,3,7.00) 48 | Path Weight: 9.00 49 | 1 -> 4: 50 | (1,2,2.00) -> (2,4,1.30) 51 | Path Weight: 3.30 52 | 1 -> 5: 53 | (1,5,3.10) 54 | Path Weight: 3.10 55 | 2 -> 3: 56 | (2,3,7.00) 57 | Path Weight: 7.00 58 | 2 -> 4: 59 | (2,4,1.30) 60 | Path Weight: 1.30 61 | 2 -> 5: 62 | (2,5,1.10) 63 | Path Weight: 1.10 64 | 3 -> 4: 65 | (3,4,8.00) 66 | Path Weight: 8.00 67 | 3 -> 5: 68 | (3,2,7.00) -> (2,5,1.10) 69 | Path Weight: 8.10 70 | 4 -> 5: 71 | (4,2,1.30) -> (2,5,1.10) 72 | Path Weight: 2.40 73 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output026.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 10.000) 3 | (0, 2, 10.100) 4 | (0, 3, 10.200) 5 | (0, 4, 10.300) 6 | (0, 5, 10.100) 7 | (0, 6, 10.200) 8 | (1, 2, 10.400) 9 | (1, 4, 10.300) 10 | (2, 3, 10.200) 11 | (2, 4, 10.100) 12 | (2, 6, 10.000) 13 | (3, 4, 10.000) 14 | (3, 6, 10.300) 15 | (4, 5, 10.500) 16 | (4, 6, 10.400) 17 | (5, 6, 10.200) 18 | 19 | Depth First Traversal (vertex visited order): 20 | [0, 1, 2, 3, 4, 5, 6] 21 | 22 | Breadth First Traversal (lowest-weight-next): 23 | [0, 1, 2, 5, 3, 6, 4] 24 | 25 | Minimum Spanning Tree: 26 | (0, 1, 10.000) 27 | (0, 2, 10.100) 28 | (0, 5, 10.100) 29 | (2, 4, 10.100) 30 | (2, 6, 10.000) 31 | (3, 4, 10.000) 32 | Type: Full Spanning Tree 33 | Total Weight: 60.300 34 | 35 | Shortest Paths: 36 | 0 -> 1: 37 | (0,1,10.00) 38 | Path Weight: 10.00 39 | 0 -> 2: 40 | (0,2,10.10) 41 | Path Weight: 10.10 42 | 0 -> 3: 43 | (0,3,10.20) 44 | Path Weight: 10.20 45 | 0 -> 4: 46 | (0,4,10.30) 47 | Path Weight: 10.30 48 | 0 -> 5: 49 | (0,5,10.10) 50 | Path Weight: 10.10 51 | 0 -> 6: 52 | (0,6,10.20) 53 | Path Weight: 10.20 54 | 1 -> 2: 55 | (1,2,10.40) 56 | Path Weight: 10.40 57 | 1 -> 3: 58 | (1,0,10.00) -> (0,3,10.20) 59 | Path Weight: 20.20 60 | 1 -> 4: 61 | (1,4,10.30) 62 | Path Weight: 10.30 63 | 1 -> 5: 64 | (1,0,10.00) -> (0,5,10.10) 65 | Path Weight: 20.10 66 | 1 -> 6: 67 | (1,0,10.00) -> (0,6,10.20) 68 | Path Weight: 20.20 69 | 2 -> 3: 70 | (2,3,10.20) 71 | Path Weight: 10.20 72 | 2 -> 4: 73 | (2,4,10.10) 74 | Path Weight: 10.10 75 | 2 -> 5: 76 | (2,6,10.00) -> (6,5,10.20) 77 | Path Weight: 20.20 78 | 2 -> 6: 79 | (2,6,10.00) 80 | Path Weight: 10.00 81 | 3 -> 4: 82 | (3,4,10.00) 83 | Path Weight: 10.00 84 | 3 -> 5: 85 | (3,0,10.20) -> (0,5,10.10) 86 | Path Weight: 20.30 87 | 3 -> 6: 88 | (3,6,10.30) 89 | Path Weight: 10.30 90 | 4 -> 5: 91 | (4,5,10.50) 92 | Path Weight: 10.50 93 | 4 -> 6: 94 | (4,6,10.40) 95 | Path Weight: 10.40 96 | 5 -> 6: 97 | (5,6,10.20) 98 | Path Weight: 10.20 99 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output028.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 1.000) 3 | (0, 3, 1.000) 4 | (0, 4, 1.000) 5 | (1, 2, 1.000) 6 | (1, 4, 1.000) 7 | (2, 3, 1.000) 8 | (2, 4, 1.000) 9 | (3, 4, 1.000) 10 | 11 | Depth First Traversal (vertex visited order): 12 | [0, 1, 2, 3, 4] 13 | 14 | Breadth First Traversal (lowest-weight-next): 15 | [0, 1, 3, 4, 2] 16 | 17 | Minimum Spanning Tree: 18 | (0, 1, 1.000) 19 | (0, 3, 1.000) 20 | (0, 4, 1.000) 21 | (1, 2, 1.000) 22 | Type: Full Spanning Tree 23 | Total Weight: 4.000 24 | 25 | Shortest Paths: 26 | 0 -> 1: 27 | (0,1,1.00) 28 | Path Weight: 1.00 29 | 0 -> 2: 30 | (0,1,1.00) -> (1,2,1.00) 31 | Path Weight: 2.00 32 | 0 -> 3: 33 | (0,3,1.00) 34 | Path Weight: 1.00 35 | 0 -> 4: 36 | (0,4,1.00) 37 | Path Weight: 1.00 38 | 1 -> 2: 39 | (1,2,1.00) 40 | Path Weight: 1.00 41 | 1 -> 3: 42 | (1,0,1.00) -> (0,3,1.00) 43 | Path Weight: 2.00 44 | 1 -> 4: 45 | (1,4,1.00) 46 | Path Weight: 1.00 47 | 2 -> 3: 48 | (2,3,1.00) 49 | Path Weight: 1.00 50 | 2 -> 4: 51 | (2,4,1.00) 52 | Path Weight: 1.00 53 | 3 -> 4: 54 | (3,4,1.00) 55 | Path Weight: 1.00 56 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output029.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 2, 5.000) 3 | (0, 3, 2.100) 4 | (1, 2, 2.500) 5 | (1, 3, 5.800) 6 | (2, 3, 3.500) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 2, 1, 3] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 3, 2, 1] 13 | 14 | Minimum Spanning Tree: 15 | (0, 3, 2.100) 16 | (1, 2, 2.500) 17 | (2, 3, 3.500) 18 | Type: Full Spanning Tree 19 | Total Weight: 8.100 20 | 21 | Shortest Paths: 22 | 0 -> 1: 23 | (0,2,5.00) -> (2,1,2.50) 24 | Path Weight: 7.50 25 | 0 -> 2: 26 | (0,2,5.00) 27 | Path Weight: 5.00 28 | 0 -> 3: 29 | (0,3,2.10) 30 | Path Weight: 2.10 31 | 1 -> 2: 32 | (1,2,2.50) 33 | Path Weight: 2.50 34 | 1 -> 3: 35 | (1,3,5.80) 36 | Path Weight: 5.80 37 | 2 -> 3: 38 | (2,3,3.50) 39 | Path Weight: 3.50 40 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output030.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 1.500) 3 | (0, 2, 1.500) 4 | (0, 3, 2.000) 5 | (0, 4, 2.500) 6 | (1, 3, 3.500) 7 | (1, 4, 3.500) 8 | (2, 5, 4.000) 9 | (3, 4, 1.500) 10 | (3, 6, 3.500) 11 | (4, 5, 1.500) 12 | (4, 6, 1.500) 13 | 14 | Depth First Traversal (vertex visited order): 15 | [0, 1, 3, 4, 5, 2, 6] 16 | 17 | Breadth First Traversal (lowest-weight-next): 18 | [0, 1, 2, 3, 4, 5, 6] 19 | 20 | Minimum Spanning Tree: 21 | (0, 1, 1.500) 22 | (0, 2, 1.500) 23 | (0, 3, 2.000) 24 | (3, 4, 1.500) 25 | (4, 5, 1.500) 26 | (4, 6, 1.500) 27 | Type: Full Spanning Tree 28 | Total Weight: 9.500 29 | 30 | Shortest Paths: 31 | 0 -> 1: 32 | (0,1,1.50) 33 | Path Weight: 1.50 34 | 0 -> 2: 35 | (0,2,1.50) 36 | Path Weight: 1.50 37 | 0 -> 3: 38 | (0,3,2.00) 39 | Path Weight: 2.00 40 | 0 -> 4: 41 | (0,4,2.50) 42 | Path Weight: 2.50 43 | 0 -> 5: 44 | (0,4,2.50) -> (4,5,1.50) 45 | Path Weight: 4.00 46 | 0 -> 6: 47 | (0,4,2.50) -> (4,6,1.50) 48 | Path Weight: 4.00 49 | 1 -> 2: 50 | (1,0,1.50) -> (0,2,1.50) 51 | Path Weight: 3.00 52 | 1 -> 3: 53 | (1,3,3.50) 54 | Path Weight: 3.50 55 | 1 -> 4: 56 | (1,4,3.50) 57 | Path Weight: 3.50 58 | 1 -> 5: 59 | (1,4,3.50) -> (4,5,1.50) 60 | Path Weight: 5.00 61 | 1 -> 6: 62 | (1,4,3.50) -> (4,6,1.50) 63 | Path Weight: 5.00 64 | 2 -> 3: 65 | (2,0,1.50) -> (0,3,2.00) 66 | Path Weight: 3.50 67 | 2 -> 4: 68 | (2,0,1.50) -> (0,4,2.50) 69 | Path Weight: 4.00 70 | 2 -> 5: 71 | (2,5,4.00) 72 | Path Weight: 4.00 73 | 2 -> 6: 74 | (2,0,1.50) -> (0,4,2.50) -> (4,6,1.50) 75 | Path Weight: 5.50 76 | 3 -> 4: 77 | (3,4,1.50) 78 | Path Weight: 1.50 79 | 3 -> 5: 80 | (3,4,1.50) -> (4,5,1.50) 81 | Path Weight: 3.00 82 | 3 -> 6: 83 | (3,4,1.50) -> (4,6,1.50) 84 | Path Weight: 3.00 85 | 4 -> 5: 86 | (4,5,1.50) 87 | Path Weight: 1.50 88 | 4 -> 6: 89 | (4,6,1.50) 90 | Path Weight: 1.50 91 | 5 -> 6: 92 | (5,4,1.50) -> (4,6,1.50) 93 | Path Weight: 3.00 94 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output031.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 4.100) 3 | (0, 3, 4.200) 4 | (1, 3, 10.200) 5 | (2, 3, 0.100) 6 | (3, 4, 8.200) 7 | (3, 5, 2.300) 8 | (3, 6, 2.400) 9 | (4, 5, 1.000) 10 | (5, 6, 11.300) 11 | (7, 8, 8.000) 12 | (7, 9, 2.300) 13 | (8, 9, 9.500) 14 | 15 | Depth First Traversal (vertex visited order): 16 | [0, 1, 3, 2, 4, 5, 6, 7, 8, 9] 17 | 18 | Breadth First Traversal (lowest-weight-next): 19 | [0, 1, 3, 2, 5, 6, 4, 7, 9, 8] 20 | 21 | Minimum Spanning Tree: 22 | (0, 1, 4.100) 23 | (0, 3, 4.200) 24 | (2, 3, 0.100) 25 | (3, 5, 2.300) 26 | (3, 6, 2.400) 27 | (4, 5, 1.000) 28 | (7, 8, 8.000) 29 | (7, 9, 2.300) 30 | Type: Spanning Forrest 31 | Total Weight: 24.400 32 | 33 | Shortest Paths: 34 | 0 -> 1: 35 | (0,1,4.10) 36 | Path Weight: 4.10 37 | 0 -> 2: 38 | (0,3,4.20) -> (3,2,0.10) 39 | Path Weight: 4.30 40 | 0 -> 3: 41 | (0,3,4.20) 42 | Path Weight: 4.20 43 | 0 -> 4: 44 | (0,3,4.20) -> (3,5,2.30) -> (5,4,1.00) 45 | Path Weight: 7.50 46 | 0 -> 5: 47 | (0,3,4.20) -> (3,5,2.30) 48 | Path Weight: 6.50 49 | 0 -> 6: 50 | (0,3,4.20) -> (3,6,2.40) 51 | Path Weight: 6.60 52 | 0 -> 7: 53 | no path 54 | 0 -> 8: 55 | no path 56 | 0 -> 9: 57 | no path 58 | 1 -> 2: 59 | (1,0,4.10) -> (0,3,4.20) -> (3,2,0.10) 60 | Path Weight: 8.40 61 | 1 -> 3: 62 | (1,0,4.10) -> (0,3,4.20) 63 | Path Weight: 8.30 64 | 1 -> 4: 65 | (1,0,4.10) -> (0,3,4.20) -> (3,5,2.30) -> (5,4,1.00) 66 | Path Weight: 11.60 67 | 1 -> 5: 68 | (1,0,4.10) -> (0,3,4.20) -> (3,5,2.30) 69 | Path Weight: 10.60 70 | 1 -> 6: 71 | (1,0,4.10) -> (0,3,4.20) -> (3,6,2.40) 72 | Path Weight: 10.70 73 | 1 -> 7: 74 | no path 75 | 1 -> 8: 76 | no path 77 | 1 -> 9: 78 | no path 79 | 2 -> 3: 80 | (2,3,0.10) 81 | Path Weight: 0.10 82 | 2 -> 4: 83 | (2,3,0.10) -> (3,5,2.30) -> (5,4,1.00) 84 | Path Weight: 3.40 85 | 2 -> 5: 86 | (2,3,0.10) -> (3,5,2.30) 87 | Path Weight: 2.40 88 | 2 -> 6: 89 | (2,3,0.10) -> (3,6,2.40) 90 | Path Weight: 2.50 91 | 2 -> 7: 92 | no path 93 | 2 -> 8: 94 | no path 95 | 2 -> 9: 96 | no path 97 | 3 -> 4: 98 | (3,5,2.30) -> (5,4,1.00) 99 | Path Weight: 3.30 100 | 3 -> 5: 101 | (3,5,2.30) 102 | Path Weight: 2.30 103 | 3 -> 6: 104 | (3,6,2.40) 105 | Path Weight: 2.40 106 | 3 -> 7: 107 | no path 108 | 3 -> 8: 109 | no path 110 | 3 -> 9: 111 | no path 112 | 4 -> 5: 113 | (4,5,1.00) 114 | Path Weight: 1.00 115 | 4 -> 6: 116 | (4,5,1.00) -> (5,3,2.30) -> (3,6,2.40) 117 | Path Weight: 5.70 118 | 4 -> 7: 119 | no path 120 | 4 -> 8: 121 | no path 122 | 4 -> 9: 123 | no path 124 | 5 -> 6: 125 | (5,3,2.30) -> (3,6,2.40) 126 | Path Weight: 4.70 127 | 5 -> 7: 128 | no path 129 | 5 -> 8: 130 | no path 131 | 5 -> 9: 132 | no path 133 | 6 -> 7: 134 | no path 135 | 6 -> 8: 136 | no path 137 | 6 -> 9: 138 | no path 139 | 7 -> 8: 140 | (7,8,8.00) 141 | Path Weight: 8.00 142 | 7 -> 9: 143 | (7,9,2.30) 144 | Path Weight: 2.30 145 | 8 -> 9: 146 | (8,9,9.50) 147 | Path Weight: 9.50 148 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output033.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 8.600) 3 | (0, 2, 3.400) 4 | (0, 7, 20.500) 5 | (1, 3, 7.700) 6 | (1, 5, 30.200) 7 | (1, 7, 11.700) 8 | (2, 5, 15.800) 9 | (3, 4, 6.400) 10 | (4, 5, 4.600) 11 | (6, 7, 1.900) 12 | 13 | Depth First Traversal (vertex visited order): 14 | [0, 1, 3, 4, 5, 2, 7, 6] 15 | 16 | Breadth First Traversal (lowest-weight-next): 17 | [0, 2, 1, 7, 5, 3, 6, 4] 18 | 19 | Minimum Spanning Tree: 20 | (0, 1, 8.600) 21 | (0, 2, 3.400) 22 | (1, 3, 7.700) 23 | (1, 7, 11.700) 24 | (3, 4, 6.400) 25 | (4, 5, 4.600) 26 | (6, 7, 1.900) 27 | Type: Full Spanning Tree 28 | Total Weight: 44.300 29 | 30 | Shortest Paths: 31 | 0 -> 1: 32 | (0,1,8.60) 33 | Path Weight: 8.60 34 | 0 -> 2: 35 | (0,2,3.40) 36 | Path Weight: 3.40 37 | 0 -> 3: 38 | (0,1,8.60) -> (1,3,7.70) 39 | Path Weight: 16.30 40 | 0 -> 4: 41 | (0,1,8.60) -> (1,3,7.70) -> (3,4,6.40) 42 | Path Weight: 22.70 43 | 0 -> 5: 44 | (0,2,3.40) -> (2,5,15.80) 45 | Path Weight: 19.20 46 | 0 -> 6: 47 | (0,1,8.60) -> (1,7,11.70) -> (7,6,1.90) 48 | Path Weight: 22.20 49 | 0 -> 7: 50 | (0,1,8.60) -> (1,7,11.70) 51 | Path Weight: 20.30 52 | 1 -> 2: 53 | (1,0,8.60) -> (0,2,3.40) 54 | Path Weight: 12.00 55 | 1 -> 3: 56 | (1,3,7.70) 57 | Path Weight: 7.70 58 | 1 -> 4: 59 | (1,3,7.70) -> (3,4,6.40) 60 | Path Weight: 14.10 61 | 1 -> 5: 62 | (1,3,7.70) -> (3,4,6.40) -> (4,5,4.60) 63 | Path Weight: 18.70 64 | 1 -> 6: 65 | (1,7,11.70) -> (7,6,1.90) 66 | Path Weight: 13.60 67 | 1 -> 7: 68 | (1,7,11.70) 69 | Path Weight: 11.70 70 | 2 -> 3: 71 | (2,0,3.40) -> (0,1,8.60) -> (1,3,7.70) 72 | Path Weight: 19.70 73 | 2 -> 4: 74 | (2,5,15.80) -> (5,4,4.60) 75 | Path Weight: 20.40 76 | 2 -> 5: 77 | (2,5,15.80) 78 | Path Weight: 15.80 79 | 2 -> 6: 80 | (2,0,3.40) -> (0,1,8.60) -> (1,7,11.70) -> (7,6,1.90) 81 | Path Weight: 25.60 82 | 2 -> 7: 83 | (2,0,3.40) -> (0,1,8.60) -> (1,7,11.70) 84 | Path Weight: 23.70 85 | 3 -> 4: 86 | (3,4,6.40) 87 | Path Weight: 6.40 88 | 3 -> 5: 89 | (3,4,6.40) -> (4,5,4.60) 90 | Path Weight: 11.00 91 | 3 -> 6: 92 | (3,1,7.70) -> (1,7,11.70) -> (7,6,1.90) 93 | Path Weight: 21.30 94 | 3 -> 7: 95 | (3,1,7.70) -> (1,7,11.70) 96 | Path Weight: 19.40 97 | 4 -> 5: 98 | (4,5,4.60) 99 | Path Weight: 4.60 100 | 4 -> 6: 101 | (4,3,6.40) -> (3,1,7.70) -> (1,7,11.70) -> (7,6,1.90) 102 | Path Weight: 27.70 103 | 4 -> 7: 104 | (4,3,6.40) -> (3,1,7.70) -> (1,7,11.70) 105 | Path Weight: 25.80 106 | 5 -> 6: 107 | (5,4,4.60) -> (4,3,6.40) -> (3,1,7.70) -> (1,7,11.70) -> (7,6,1.90) 108 | Path Weight: 32.30 109 | 5 -> 7: 110 | (5,4,4.60) -> (4,3,6.40) -> (3,1,7.70) -> (1,7,11.70) 111 | Path Weight: 30.40 112 | 6 -> 7: 113 | (6,7,1.90) 114 | Path Weight: 1.90 115 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output034.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 4.500) 3 | (0, 3, 7.300) 4 | (1, 2, 5.600) 5 | (1, 3, 3.400) 6 | (2, 3, 6.800) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 1, 2, 3] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 1, 3, 2] 13 | 14 | Minimum Spanning Tree: 15 | (0, 1, 4.500) 16 | (1, 2, 5.600) 17 | (1, 3, 3.400) 18 | Type: Full Spanning Tree 19 | Total Weight: 13.500 20 | 21 | Shortest Paths: 22 | 0 -> 1: 23 | (0,1,4.50) 24 | Path Weight: 4.50 25 | 0 -> 2: 26 | (0,1,4.50) -> (1,2,5.60) 27 | Path Weight: 10.10 28 | 0 -> 3: 29 | (0,3,7.30) 30 | Path Weight: 7.30 31 | 1 -> 2: 32 | (1,2,5.60) 33 | Path Weight: 5.60 34 | 1 -> 3: 35 | (1,3,3.40) 36 | Path Weight: 3.40 37 | 2 -> 3: 38 | (2,3,6.80) 39 | Path Weight: 6.80 40 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output035.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 15.000) 3 | (0, 2, 25.000) 4 | (1, 8, 25.000) 5 | (1, 4, 10.000) 6 | (1, 7, 5.000) 7 | (2, 3, 10.000) 8 | (2, 4, 20.000) 9 | (4, 5, 10.000) 10 | (4, 6, 5.000) 11 | (7, 8, 15.000) 12 | 13 | Depth First Traversal (vertex visited order): 14 | [0, 1, 4, 2, 3, 5, 6, 7, 8] 15 | 16 | Breadth First Traversal (lowest-weight-next): 17 | [0, 1, 2, 7, 4, 8, 3, 6, 5] 18 | 19 | Minimum Spanning Tree: 20 | (0, 1, 15.000) 21 | (1, 4, 10.000) 22 | (1, 7, 5.000) 23 | (2, 3, 10.000) 24 | (2, 4, 20.000) 25 | (4, 5, 10.000) 26 | (4, 6, 5.000) 27 | (7, 8, 15.000) 28 | Type: Full Spanning Tree 29 | Total Weight: 90.000 30 | 31 | Shortest Paths: 32 | 0 -> 1: 33 | (0,1,15.00) 34 | Path Weight: 15.00 35 | 0 -> 2: 36 | (0,2,25.00) 37 | Path Weight: 25.00 38 | 0 -> 3: 39 | (0,2,25.00) -> (2,3,10.00) 40 | Path Weight: 35.00 41 | 0 -> 4: 42 | (0,1,15.00) -> (1,4,10.00) 43 | Path Weight: 25.00 44 | 0 -> 5: 45 | (0,1,15.00) -> (1,4,10.00) -> (4,5,10.00) 46 | Path Weight: 35.00 47 | 0 -> 6: 48 | (0,1,15.00) -> (1,4,10.00) -> (4,6,5.00) 49 | Path Weight: 30.00 50 | 0 -> 7: 51 | (0,1,15.00) -> (1,7,5.00) 52 | Path Weight: 20.00 53 | 0 -> 8: 54 | (0,1,15.00) -> (1,7,5.00) -> (7,8,15.00) 55 | Path Weight: 35.00 56 | 1 -> 2: 57 | (1,4,10.00) -> (4,2,20.00) 58 | Path Weight: 30.00 59 | 1 -> 3: 60 | (1,4,10.00) -> (4,2,20.00) -> (2,3,10.00) 61 | Path Weight: 40.00 62 | 1 -> 4: 63 | (1,4,10.00) 64 | Path Weight: 10.00 65 | 1 -> 5: 66 | (1,4,10.00) -> (4,5,10.00) 67 | Path Weight: 20.00 68 | 1 -> 6: 69 | (1,4,10.00) -> (4,6,5.00) 70 | Path Weight: 15.00 71 | 1 -> 7: 72 | (1,7,5.00) 73 | Path Weight: 5.00 74 | 1 -> 8: 75 | (1,7,5.00) -> (7,8,15.00) 76 | Path Weight: 20.00 77 | 2 -> 3: 78 | (2,3,10.00) 79 | Path Weight: 10.00 80 | 2 -> 4: 81 | (2,4,20.00) 82 | Path Weight: 20.00 83 | 2 -> 5: 84 | (2,4,20.00) -> (4,5,10.00) 85 | Path Weight: 30.00 86 | 2 -> 6: 87 | (2,4,20.00) -> (4,6,5.00) 88 | Path Weight: 25.00 89 | 2 -> 7: 90 | (2,4,20.00) -> (4,1,10.00) -> (1,7,5.00) 91 | Path Weight: 35.00 92 | 2 -> 8: 93 | (2,4,20.00) -> (4,1,10.00) -> (1,7,5.00) -> (7,8,15.00) 94 | Path Weight: 50.00 95 | 3 -> 4: 96 | (3,2,10.00) -> (2,4,20.00) 97 | Path Weight: 30.00 98 | 3 -> 5: 99 | (3,2,10.00) -> (2,4,20.00) -> (4,5,10.00) 100 | Path Weight: 40.00 101 | 3 -> 6: 102 | (3,2,10.00) -> (2,4,20.00) -> (4,6,5.00) 103 | Path Weight: 35.00 104 | 3 -> 7: 105 | (3,2,10.00) -> (2,4,20.00) -> (4,1,10.00) -> (1,7,5.00) 106 | Path Weight: 45.00 107 | 3 -> 8: 108 | (3,2,10.00) -> (2,4,20.00) -> (4,1,10.00) -> (1,7,5.00) -> (7,8,15.00) 109 | Path Weight: 60.00 110 | 4 -> 5: 111 | (4,5,10.00) 112 | Path Weight: 10.00 113 | 4 -> 6: 114 | (4,6,5.00) 115 | Path Weight: 5.00 116 | 4 -> 7: 117 | (4,1,10.00) -> (1,7,5.00) 118 | Path Weight: 15.00 119 | 4 -> 8: 120 | (4,1,10.00) -> (1,7,5.00) -> (7,8,15.00) 121 | Path Weight: 30.00 122 | 5 -> 6: 123 | (5,4,10.00) -> (4,6,5.00) 124 | Path Weight: 15.00 125 | 5 -> 7: 126 | (5,4,10.00) -> (4,1,10.00) -> (1,7,5.00) 127 | Path Weight: 25.00 128 | 5 -> 8: 129 | (5,4,10.00) -> (4,1,10.00) -> (1,7,5.00) -> (7,8,15.00) 130 | Path Weight: 40.00 131 | 6 -> 7: 132 | (6,4,5.00) -> (4,1,10.00) -> (1,7,5.00) 133 | Path Weight: 20.00 134 | 6 -> 8: 135 | (6,4,5.00) -> (4,1,10.00) -> (1,7,5.00) -> (7,8,15.00) 136 | Path Weight: 35.00 137 | 7 -> 8: 138 | (7,8,15.00) 139 | Path Weight: 15.00 140 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output036.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 18.760) 3 | (0, 2, 66.250) 4 | (1, 3, 8.070) 5 | (1, 4, 90.280) 6 | (2, 5, 59.510) 7 | (2, 6, 53.020) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 1, 3, 4, 2, 5, 6] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 1, 2, 3, 4, 6, 5] 14 | 15 | Minimum Spanning Tree: 16 | (0, 1, 18.760) 17 | (0, 2, 66.250) 18 | (1, 3, 8.070) 19 | (1, 4, 90.280) 20 | (2, 5, 59.510) 21 | (2, 6, 53.020) 22 | Type: Full Spanning Tree 23 | Total Weight: 295.890 24 | 25 | Shortest Paths: 26 | 0 -> 1: 27 | (0,1,18.76) 28 | Path Weight: 18.76 29 | 0 -> 2: 30 | (0,2,66.25) 31 | Path Weight: 66.25 32 | 0 -> 3: 33 | (0,1,18.76) -> (1,3,8.07) 34 | Path Weight: 26.83 35 | 0 -> 4: 36 | (0,1,18.76) -> (1,4,90.28) 37 | Path Weight: 109.04 38 | 0 -> 5: 39 | (0,2,66.25) -> (2,5,59.51) 40 | Path Weight: 125.76 41 | 0 -> 6: 42 | (0,2,66.25) -> (2,6,53.02) 43 | Path Weight: 119.27 44 | 1 -> 2: 45 | (1,0,18.76) -> (0,2,66.25) 46 | Path Weight: 85.01 47 | 1 -> 3: 48 | (1,3,8.07) 49 | Path Weight: 8.07 50 | 1 -> 4: 51 | (1,4,90.28) 52 | Path Weight: 90.28 53 | 1 -> 5: 54 | (1,0,18.76) -> (0,2,66.25) -> (2,5,59.51) 55 | Path Weight: 144.52 56 | 1 -> 6: 57 | (1,0,18.76) -> (0,2,66.25) -> (2,6,53.02) 58 | Path Weight: 138.03 59 | 2 -> 3: 60 | (2,0,66.25) -> (0,1,18.76) -> (1,3,8.07) 61 | Path Weight: 93.08 62 | 2 -> 4: 63 | (2,0,66.25) -> (0,1,18.76) -> (1,4,90.28) 64 | Path Weight: 175.29 65 | 2 -> 5: 66 | (2,5,59.51) 67 | Path Weight: 59.51 68 | 2 -> 6: 69 | (2,6,53.02) 70 | Path Weight: 53.02 71 | 3 -> 4: 72 | (3,1,8.07) -> (1,4,90.28) 73 | Path Weight: 98.35 74 | 3 -> 5: 75 | (3,1,8.07) -> (1,0,18.76) -> (0,2,66.25) -> (2,5,59.51) 76 | Path Weight: 152.59 77 | 3 -> 6: 78 | (3,1,8.07) -> (1,0,18.76) -> (0,2,66.25) -> (2,6,53.02) 79 | Path Weight: 146.10 80 | 4 -> 5: 81 | (4,1,90.28) -> (1,0,18.76) -> (0,2,66.25) -> (2,5,59.51) 82 | Path Weight: 234.80 83 | 4 -> 6: 84 | (4,1,90.28) -> (1,0,18.76) -> (0,2,66.25) -> (2,6,53.02) 85 | Path Weight: 228.31 86 | 5 -> 6: 87 | (5,2,59.51) -> (2,6,53.02) 88 | Path Weight: 112.53 89 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output037.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 2.000) 3 | (0, 2, 5.000) 4 | (0, 4, 4.000) 5 | (0, 5, 1.700) 6 | (3, 4, 3.000) 7 | (3, 5, 3.500) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 1, 2, 4, 3, 5] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 5, 1, 4, 2, 3] 14 | 15 | Minimum Spanning Tree: 16 | (0, 1, 2.000) 17 | (0, 2, 5.000) 18 | (0, 5, 1.700) 19 | (3, 4, 3.000) 20 | (3, 5, 3.500) 21 | Type: Full Spanning Tree 22 | Total Weight: 15.200 23 | 24 | Shortest Paths: 25 | 0 -> 1: 26 | (0,1,2.00) 27 | Path Weight: 2.00 28 | 0 -> 2: 29 | (0,2,5.00) 30 | Path Weight: 5.00 31 | 0 -> 3: 32 | (0,5,1.70) -> (5,3,3.50) 33 | Path Weight: 5.20 34 | 0 -> 4: 35 | (0,4,4.00) 36 | Path Weight: 4.00 37 | 0 -> 5: 38 | (0,5,1.70) 39 | Path Weight: 1.70 40 | 1 -> 2: 41 | (1,0,2.00) -> (0,2,5.00) 42 | Path Weight: 7.00 43 | 1 -> 3: 44 | (1,0,2.00) -> (0,5,1.70) -> (5,3,3.50) 45 | Path Weight: 7.20 46 | 1 -> 4: 47 | (1,0,2.00) -> (0,4,4.00) 48 | Path Weight: 6.00 49 | 1 -> 5: 50 | (1,0,2.00) -> (0,5,1.70) 51 | Path Weight: 3.70 52 | 2 -> 3: 53 | (2,0,5.00) -> (0,5,1.70) -> (5,3,3.50) 54 | Path Weight: 10.20 55 | 2 -> 4: 56 | (2,0,5.00) -> (0,4,4.00) 57 | Path Weight: 9.00 58 | 2 -> 5: 59 | (2,0,5.00) -> (0,5,1.70) 60 | Path Weight: 6.70 61 | 3 -> 4: 62 | (3,4,3.00) 63 | Path Weight: 3.00 64 | 3 -> 5: 65 | (3,5,3.50) 66 | Path Weight: 3.50 67 | 4 -> 5: 68 | (4,0,4.00) -> (0,5,1.70) 69 | Path Weight: 5.70 70 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output038.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 3, 1.100) 3 | (0, 4, 3.000) 4 | (0, 5, 1.300) 5 | (0, 6, 2.000) 6 | (1, 4, 2.700) 7 | (2, 4, 4.000) 8 | (2, 5, 10.000) 9 | 10 | Depth First Traversal (vertex visited order): 11 | [0, 3, 4, 1, 2, 5, 6] 12 | 13 | Breadth First Traversal (lowest-weight-next): 14 | [0, 3, 5, 6, 4, 2, 1] 15 | 16 | Minimum Spanning Tree: 17 | (0, 3, 1.100) 18 | (0, 4, 3.000) 19 | (0, 5, 1.300) 20 | (0, 6, 2.000) 21 | (1, 4, 2.700) 22 | (2, 4, 4.000) 23 | Type: Full Spanning Tree 24 | Total Weight: 14.100 25 | 26 | Shortest Paths: 27 | 0 -> 1: 28 | (0,4,3.00) -> (4,1,2.70) 29 | Path Weight: 5.70 30 | 0 -> 2: 31 | (0,4,3.00) -> (4,2,4.00) 32 | Path Weight: 7.00 33 | 0 -> 3: 34 | (0,3,1.10) 35 | Path Weight: 1.10 36 | 0 -> 4: 37 | (0,4,3.00) 38 | Path Weight: 3.00 39 | 0 -> 5: 40 | (0,5,1.30) 41 | Path Weight: 1.30 42 | 0 -> 6: 43 | (0,6,2.00) 44 | Path Weight: 2.00 45 | 1 -> 2: 46 | (1,4,2.70) -> (4,2,4.00) 47 | Path Weight: 6.70 48 | 1 -> 3: 49 | (1,4,2.70) -> (4,0,3.00) -> (0,3,1.10) 50 | Path Weight: 6.80 51 | 1 -> 4: 52 | (1,4,2.70) 53 | Path Weight: 2.70 54 | 1 -> 5: 55 | (1,4,2.70) -> (4,0,3.00) -> (0,5,1.30) 56 | Path Weight: 7.00 57 | 1 -> 6: 58 | (1,4,2.70) -> (4,0,3.00) -> (0,6,2.00) 59 | Path Weight: 7.70 60 | 2 -> 3: 61 | (2,4,4.00) -> (4,0,3.00) -> (0,3,1.10) 62 | Path Weight: 8.10 63 | 2 -> 4: 64 | (2,4,4.00) 65 | Path Weight: 4.00 66 | 2 -> 5: 67 | (2,4,4.00) -> (4,0,3.00) -> (0,5,1.30) 68 | Path Weight: 8.30 69 | 2 -> 6: 70 | (2,4,4.00) -> (4,0,3.00) -> (0,6,2.00) 71 | Path Weight: 9.00 72 | 3 -> 4: 73 | (3,0,1.10) -> (0,4,3.00) 74 | Path Weight: 4.10 75 | 3 -> 5: 76 | (3,0,1.10) -> (0,5,1.30) 77 | Path Weight: 2.40 78 | 3 -> 6: 79 | (3,0,1.10) -> (0,6,2.00) 80 | Path Weight: 3.10 81 | 4 -> 5: 82 | (4,0,3.00) -> (0,5,1.30) 83 | Path Weight: 4.30 84 | 4 -> 6: 85 | (4,0,3.00) -> (0,6,2.00) 86 | Path Weight: 5.00 87 | 5 -> 6: 88 | (5,0,1.30) -> (0,6,2.00) 89 | Path Weight: 3.30 90 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output039.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 4.000) 3 | (0, 5, 2.000) 4 | (1, 2, 5.000) 5 | (1, 4, 5.000) 6 | (2, 3, 6.000) 7 | (2, 5, 3.000) 8 | (3, 4, 7.000) 9 | 10 | Depth First Traversal (vertex visited order): 11 | [0, 1, 2, 3, 4, 5] 12 | 13 | Breadth First Traversal (lowest-weight-next): 14 | [0, 5, 1, 2, 4, 3] 15 | 16 | Minimum Spanning Tree: 17 | (0, 1, 4.000) 18 | (0, 5, 2.000) 19 | (1, 4, 5.000) 20 | (2, 3, 6.000) 21 | (2, 5, 3.000) 22 | Type: Full Spanning Tree 23 | Total Weight: 20.000 24 | 25 | Shortest Paths: 26 | 0 -> 1: 27 | (0,1,4.00) 28 | Path Weight: 4.00 29 | 0 -> 2: 30 | (0,5,2.00) -> (5,2,3.00) 31 | Path Weight: 5.00 32 | 0 -> 3: 33 | (0,5,2.00) -> (5,2,3.00) -> (2,3,6.00) 34 | Path Weight: 11.00 35 | 0 -> 4: 36 | (0,1,4.00) -> (1,4,5.00) 37 | Path Weight: 9.00 38 | 0 -> 5: 39 | (0,5,2.00) 40 | Path Weight: 2.00 41 | 1 -> 2: 42 | (1,2,5.00) 43 | Path Weight: 5.00 44 | 1 -> 3: 45 | (1,2,5.00) -> (2,3,6.00) 46 | Path Weight: 11.00 47 | 1 -> 4: 48 | (1,4,5.00) 49 | Path Weight: 5.00 50 | 1 -> 5: 51 | (1,0,4.00) -> (0,5,2.00) 52 | Path Weight: 6.00 53 | 2 -> 3: 54 | (2,3,6.00) 55 | Path Weight: 6.00 56 | 2 -> 4: 57 | (2,1,5.00) -> (1,4,5.00) 58 | Path Weight: 10.00 59 | 2 -> 5: 60 | (2,5,3.00) 61 | Path Weight: 3.00 62 | 3 -> 4: 63 | (3,4,7.00) 64 | Path Weight: 7.00 65 | 3 -> 5: 66 | (3,2,6.00) -> (2,5,3.00) 67 | Path Weight: 9.00 68 | 4 -> 5: 69 | (4,1,5.00) -> (1,0,4.00) -> (0,5,2.00) 70 | Path Weight: 11.00 71 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output040.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 4, 2.000) 3 | (0, 5, 3.000) 4 | (1, 2, 7.000) 5 | (1, 3, 1.000) 6 | (1, 4, 8.000) 7 | (2, 5, 3.000) 8 | (3, 5, 6.000) 9 | (4, 5, 9.000) 10 | 11 | Depth First Traversal (vertex visited order): 12 | [0, 4, 1, 2, 5, 3] 13 | 14 | Breadth First Traversal (lowest-weight-next): 15 | [0, 4, 5, 1, 2, 3] 16 | 17 | Minimum Spanning Tree: 18 | (0, 4, 2.000) 19 | (0, 5, 3.000) 20 | (1, 3, 1.000) 21 | (2, 5, 3.000) 22 | (3, 5, 6.000) 23 | Type: Full Spanning Tree 24 | Total Weight: 15.000 25 | 26 | Shortest Paths: 27 | 0 -> 1: 28 | (0,4,2.00) -> (4,1,8.00) 29 | Path Weight: 10.00 30 | 0 -> 2: 31 | (0,5,3.00) -> (5,2,3.00) 32 | Path Weight: 6.00 33 | 0 -> 3: 34 | (0,5,3.00) -> (5,3,6.00) 35 | Path Weight: 9.00 36 | 0 -> 4: 37 | (0,4,2.00) 38 | Path Weight: 2.00 39 | 0 -> 5: 40 | (0,5,3.00) 41 | Path Weight: 3.00 42 | 1 -> 2: 43 | (1,2,7.00) 44 | Path Weight: 7.00 45 | 1 -> 3: 46 | (1,3,1.00) 47 | Path Weight: 1.00 48 | 1 -> 4: 49 | (1,4,8.00) 50 | Path Weight: 8.00 51 | 1 -> 5: 52 | (1,3,1.00) -> (3,5,6.00) 53 | Path Weight: 7.00 54 | 2 -> 3: 55 | (2,1,7.00) -> (1,3,1.00) 56 | Path Weight: 8.00 57 | 2 -> 4: 58 | (2,5,3.00) -> (5,0,3.00) -> (0,4,2.00) 59 | Path Weight: 8.00 60 | 2 -> 5: 61 | (2,5,3.00) 62 | Path Weight: 3.00 63 | 3 -> 4: 64 | (3,1,1.00) -> (1,4,8.00) 65 | Path Weight: 9.00 66 | 3 -> 5: 67 | (3,5,6.00) 68 | Path Weight: 6.00 69 | 4 -> 5: 70 | (4,0,2.00) -> (0,5,3.00) 71 | Path Weight: 5.00 72 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output041.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 4, 2.000) 3 | (0, 5, 3.000) 4 | (1, 2, 7.000) 5 | (1, 3, 1.000) 6 | (1, 4, 8.000) 7 | (2, 5, 3.000) 8 | (3, 5, 6.000) 9 | (4, 5, 9.000) 10 | (6, 7, 12.300) 11 | (7, 8, 3.300) 12 | 13 | Depth First Traversal (vertex visited order): 14 | [0, 4, 1, 2, 5, 3, 6, 7, 8] 15 | 16 | Breadth First Traversal (lowest-weight-next): 17 | [0, 4, 5, 1, 2, 3, 6, 7, 8] 18 | 19 | Minimum Spanning Tree: 20 | (0, 4, 2.000) 21 | (0, 5, 3.000) 22 | (1, 3, 1.000) 23 | (2, 5, 3.000) 24 | (3, 5, 6.000) 25 | (6, 7, 12.300) 26 | (7, 8, 3.300) 27 | Type: Spanning Forrest 28 | Total Weight: 30.600 29 | 30 | Shortest Paths: 31 | 0 -> 1: 32 | (0,4,2.00) -> (4,1,8.00) 33 | Path Weight: 10.00 34 | 0 -> 2: 35 | (0,5,3.00) -> (5,2,3.00) 36 | Path Weight: 6.00 37 | 0 -> 3: 38 | (0,5,3.00) -> (5,3,6.00) 39 | Path Weight: 9.00 40 | 0 -> 4: 41 | (0,4,2.00) 42 | Path Weight: 2.00 43 | 0 -> 5: 44 | (0,5,3.00) 45 | Path Weight: 3.00 46 | 0 -> 6: 47 | no path 48 | 0 -> 7: 49 | no path 50 | 0 -> 8: 51 | no path 52 | 1 -> 2: 53 | (1,2,7.00) 54 | Path Weight: 7.00 55 | 1 -> 3: 56 | (1,3,1.00) 57 | Path Weight: 1.00 58 | 1 -> 4: 59 | (1,4,8.00) 60 | Path Weight: 8.00 61 | 1 -> 5: 62 | (1,3,1.00) -> (3,5,6.00) 63 | Path Weight: 7.00 64 | 1 -> 6: 65 | no path 66 | 1 -> 7: 67 | no path 68 | 1 -> 8: 69 | no path 70 | 2 -> 3: 71 | (2,1,7.00) -> (1,3,1.00) 72 | Path Weight: 8.00 73 | 2 -> 4: 74 | (2,5,3.00) -> (5,0,3.00) -> (0,4,2.00) 75 | Path Weight: 8.00 76 | 2 -> 5: 77 | (2,5,3.00) 78 | Path Weight: 3.00 79 | 2 -> 6: 80 | no path 81 | 2 -> 7: 82 | no path 83 | 2 -> 8: 84 | no path 85 | 3 -> 4: 86 | (3,1,1.00) -> (1,4,8.00) 87 | Path Weight: 9.00 88 | 3 -> 5: 89 | (3,5,6.00) 90 | Path Weight: 6.00 91 | 3 -> 6: 92 | no path 93 | 3 -> 7: 94 | no path 95 | 3 -> 8: 96 | no path 97 | 4 -> 5: 98 | (4,0,2.00) -> (0,5,3.00) 99 | Path Weight: 5.00 100 | 4 -> 6: 101 | no path 102 | 4 -> 7: 103 | no path 104 | 4 -> 8: 105 | no path 106 | 5 -> 6: 107 | no path 108 | 5 -> 7: 109 | no path 110 | 5 -> 8: 111 | no path 112 | 6 -> 7: 113 | (6,7,12.30) 114 | Path Weight: 12.30 115 | 6 -> 8: 116 | (6,7,12.30) -> (7,8,3.30) 117 | Path Weight: 15.60 118 | 7 -> 8: 119 | (7,8,3.30) 120 | Path Weight: 3.30 121 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output042.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 4, 2.000) 3 | (0, 5, 3.000) 4 | (1, 2, 7.000) 5 | (1, 3, 1.000) 6 | (1, 4, 8.000) 7 | (2, 5, 3.000) 8 | (3, 5, 6.000) 9 | (4, 5, 9.000) 10 | (6, 7, 12.300) 11 | (7, 8, 3.300) 12 | (9, 10, 66.000) 13 | 14 | Depth First Traversal (vertex visited order): 15 | [0, 4, 1, 2, 5, 3, 6, 7, 8, 9, 10] 16 | 17 | Breadth First Traversal (lowest-weight-next): 18 | [0, 4, 5, 1, 2, 3, 6, 7, 8, 9, 10] 19 | 20 | Minimum Spanning Tree: 21 | (0, 4, 2.000) 22 | (0, 5, 3.000) 23 | (1, 3, 1.000) 24 | (2, 5, 3.000) 25 | (3, 5, 6.000) 26 | (6, 7, 12.300) 27 | (7, 8, 3.300) 28 | (9, 10, 66.000) 29 | Type: Spanning Forrest 30 | Total Weight: 96.600 31 | 32 | Shortest Paths: 33 | 0 -> 1: 34 | (0,4,2.00) -> (4,1,8.00) 35 | Path Weight: 10.00 36 | 0 -> 2: 37 | (0,5,3.00) -> (5,2,3.00) 38 | Path Weight: 6.00 39 | 0 -> 3: 40 | (0,5,3.00) -> (5,3,6.00) 41 | Path Weight: 9.00 42 | 0 -> 4: 43 | (0,4,2.00) 44 | Path Weight: 2.00 45 | 0 -> 5: 46 | (0,5,3.00) 47 | Path Weight: 3.00 48 | 0 -> 6: 49 | no path 50 | 0 -> 7: 51 | no path 52 | 0 -> 8: 53 | no path 54 | 0 -> 9: 55 | no path 56 | 0 -> 10: 57 | no path 58 | 1 -> 2: 59 | (1,2,7.00) 60 | Path Weight: 7.00 61 | 1 -> 3: 62 | (1,3,1.00) 63 | Path Weight: 1.00 64 | 1 -> 4: 65 | (1,4,8.00) 66 | Path Weight: 8.00 67 | 1 -> 5: 68 | (1,3,1.00) -> (3,5,6.00) 69 | Path Weight: 7.00 70 | 1 -> 6: 71 | no path 72 | 1 -> 7: 73 | no path 74 | 1 -> 8: 75 | no path 76 | 1 -> 9: 77 | no path 78 | 1 -> 10: 79 | no path 80 | 2 -> 3: 81 | (2,1,7.00) -> (1,3,1.00) 82 | Path Weight: 8.00 83 | 2 -> 4: 84 | (2,5,3.00) -> (5,0,3.00) -> (0,4,2.00) 85 | Path Weight: 8.00 86 | 2 -> 5: 87 | (2,5,3.00) 88 | Path Weight: 3.00 89 | 2 -> 6: 90 | no path 91 | 2 -> 7: 92 | no path 93 | 2 -> 8: 94 | no path 95 | 2 -> 9: 96 | no path 97 | 2 -> 10: 98 | no path 99 | 3 -> 4: 100 | (3,1,1.00) -> (1,4,8.00) 101 | Path Weight: 9.00 102 | 3 -> 5: 103 | (3,5,6.00) 104 | Path Weight: 6.00 105 | 3 -> 6: 106 | no path 107 | 3 -> 7: 108 | no path 109 | 3 -> 8: 110 | no path 111 | 3 -> 9: 112 | no path 113 | 3 -> 10: 114 | no path 115 | 4 -> 5: 116 | (4,0,2.00) -> (0,5,3.00) 117 | Path Weight: 5.00 118 | 4 -> 6: 119 | no path 120 | 4 -> 7: 121 | no path 122 | 4 -> 8: 123 | no path 124 | 4 -> 9: 125 | no path 126 | 4 -> 10: 127 | no path 128 | 5 -> 6: 129 | no path 130 | 5 -> 7: 131 | no path 132 | 5 -> 8: 133 | no path 134 | 5 -> 9: 135 | no path 136 | 5 -> 10: 137 | no path 138 | 6 -> 7: 139 | (6,7,12.30) 140 | Path Weight: 12.30 141 | 6 -> 8: 142 | (6,7,12.30) -> (7,8,3.30) 143 | Path Weight: 15.60 144 | 6 -> 9: 145 | no path 146 | 6 -> 10: 147 | no path 148 | 7 -> 8: 149 | (7,8,3.30) 150 | Path Weight: 3.30 151 | 7 -> 9: 152 | no path 153 | 7 -> 10: 154 | no path 155 | 8 -> 9: 156 | no path 157 | 8 -> 10: 158 | no path 159 | 9 -> 10: 160 | (9,10,66.00) 161 | Path Weight: 66.00 162 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output043.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 3.000) 3 | (0, 2, 2.100) 4 | (0, 3, 4.300) 5 | (1, 2, 1.140) 6 | (1, 3, 2.500) 7 | (2, 3, 1.900) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 1, 2, 3] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 2, 1, 3] 14 | 15 | Minimum Spanning Tree: 16 | (0, 2, 2.100) 17 | (1, 2, 1.140) 18 | (2, 3, 1.900) 19 | Type: Full Spanning Tree 20 | Total Weight: 5.140 21 | 22 | Shortest Paths: 23 | 0 -> 1: 24 | (0,1,3.00) 25 | Path Weight: 3.00 26 | 0 -> 2: 27 | (0,2,2.10) 28 | Path Weight: 2.10 29 | 0 -> 3: 30 | (0,2,2.10) -> (2,3,1.90) 31 | Path Weight: 4.00 32 | 1 -> 2: 33 | (1,2,1.14) 34 | Path Weight: 1.14 35 | 1 -> 3: 36 | (1,3,2.50) 37 | Path Weight: 2.50 38 | 2 -> 3: 39 | (2,3,1.90) 40 | Path Weight: 1.90 41 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output044.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 4, 2.000) 3 | (0, 5, 3.140) 4 | (1, 3, 7.200) 5 | (1, 4, 1.000) 6 | (1, 5, 8.000) 7 | (2, 5, 3.000) 8 | (3, 4, 6.900) 9 | (3, 5, 2.890) 10 | (4, 5, 9.700) 11 | 12 | Depth First Traversal (vertex visited order): 13 | [0, 4, 1, 3, 5, 2] 14 | 15 | Breadth First Traversal (lowest-weight-next): 16 | [0, 4, 5, 1, 3, 2] 17 | 18 | Minimum Spanning Tree: 19 | (0, 4, 2.000) 20 | (0, 5, 3.140) 21 | (1, 4, 1.000) 22 | (2, 5, 3.000) 23 | (3, 5, 2.890) 24 | Type: Full Spanning Tree 25 | Total Weight: 12.030 26 | 27 | Shortest Paths: 28 | 0 -> 1: 29 | (0,4,2.00) -> (4,1,1.00) 30 | Path Weight: 3.00 31 | 0 -> 2: 32 | (0,5,3.14) -> (5,2,3.00) 33 | Path Weight: 6.14 34 | 0 -> 3: 35 | (0,5,3.14) -> (5,3,2.89) 36 | Path Weight: 6.03 37 | 0 -> 4: 38 | (0,4,2.00) 39 | Path Weight: 2.00 40 | 0 -> 5: 41 | (0,5,3.14) 42 | Path Weight: 3.14 43 | 1 -> 2: 44 | (1,4,1.00) -> (4,0,2.00) -> (0,5,3.14) -> (5,2,3.00) 45 | Path Weight: 9.14 46 | 1 -> 3: 47 | (1,3,7.20) 48 | Path Weight: 7.20 49 | 1 -> 4: 50 | (1,4,1.00) 51 | Path Weight: 1.00 52 | 1 -> 5: 53 | (1,4,1.00) -> (4,0,2.00) -> (0,5,3.14) 54 | Path Weight: 6.14 55 | 2 -> 3: 56 | (2,5,3.00) -> (5,3,2.89) 57 | Path Weight: 5.89 58 | 2 -> 4: 59 | (2,5,3.00) -> (5,0,3.14) -> (0,4,2.00) 60 | Path Weight: 8.14 61 | 2 -> 5: 62 | (2,5,3.00) 63 | Path Weight: 3.00 64 | 3 -> 4: 65 | (3,4,6.90) 66 | Path Weight: 6.90 67 | 3 -> 5: 68 | (3,5,2.89) 69 | Path Weight: 2.89 70 | 4 -> 5: 71 | (4,0,2.00) -> (0,5,3.14) 72 | Path Weight: 5.14 73 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output045.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 2, 3.000) 3 | (0, 3, 2.100) 4 | (0, 4, 4.300) 5 | (1, 2, 3.140) 6 | (1, 3, 2.500) 7 | (2, 3, 3.900) 8 | (2, 4, 10.300) 9 | 10 | Depth First Traversal (vertex visited order): 11 | [0, 2, 1, 3, 4] 12 | 13 | Breadth First Traversal (lowest-weight-next): 14 | [0, 3, 2, 4, 1] 15 | 16 | Minimum Spanning Tree: 17 | (0, 2, 3.000) 18 | (0, 3, 2.100) 19 | (0, 4, 4.300) 20 | (1, 3, 2.500) 21 | Type: Full Spanning Tree 22 | Total Weight: 11.900 23 | 24 | Shortest Paths: 25 | 0 -> 1: 26 | (0,3,2.10) -> (3,1,2.50) 27 | Path Weight: 4.60 28 | 0 -> 2: 29 | (0,2,3.00) 30 | Path Weight: 3.00 31 | 0 -> 3: 32 | (0,3,2.10) 33 | Path Weight: 2.10 34 | 0 -> 4: 35 | (0,4,4.30) 36 | Path Weight: 4.30 37 | 1 -> 2: 38 | (1,2,3.14) 39 | Path Weight: 3.14 40 | 1 -> 3: 41 | (1,3,2.50) 42 | Path Weight: 2.50 43 | 1 -> 4: 44 | (1,3,2.50) -> (3,0,2.10) -> (0,4,4.30) 45 | Path Weight: 8.90 46 | 2 -> 3: 47 | (2,3,3.90) 48 | Path Weight: 3.90 49 | 2 -> 4: 50 | (2,0,3.00) -> (0,4,4.30) 51 | Path Weight: 7.30 52 | 3 -> 4: 53 | (3,0,2.10) -> (0,4,4.30) 54 | Path Weight: 6.40 55 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output046.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 4.000) 3 | (0, 5, 2.000) 4 | (1, 2, 5.000) 5 | (1, 4, 5.000) 6 | (2, 3, 6.000) 7 | (2, 5, 3.000) 8 | (3, 4, 7.000) 9 | 10 | Depth First Traversal (vertex visited order): 11 | [0, 1, 2, 3, 4, 5] 12 | 13 | Breadth First Traversal (lowest-weight-next): 14 | [0, 5, 1, 2, 4, 3] 15 | 16 | Minimum Spanning Tree: 17 | (0, 1, 4.000) 18 | (0, 5, 2.000) 19 | (1, 4, 5.000) 20 | (2, 3, 6.000) 21 | (2, 5, 3.000) 22 | Type: Full Spanning Tree 23 | Total Weight: 20.000 24 | 25 | Shortest Paths: 26 | 0 -> 1: 27 | (0,1,4.00) 28 | Path Weight: 4.00 29 | 0 -> 2: 30 | (0,5,2.00) -> (5,2,3.00) 31 | Path Weight: 5.00 32 | 0 -> 3: 33 | (0,5,2.00) -> (5,2,3.00) -> (2,3,6.00) 34 | Path Weight: 11.00 35 | 0 -> 4: 36 | (0,1,4.00) -> (1,4,5.00) 37 | Path Weight: 9.00 38 | 0 -> 5: 39 | (0,5,2.00) 40 | Path Weight: 2.00 41 | 1 -> 2: 42 | (1,2,5.00) 43 | Path Weight: 5.00 44 | 1 -> 3: 45 | (1,2,5.00) -> (2,3,6.00) 46 | Path Weight: 11.00 47 | 1 -> 4: 48 | (1,4,5.00) 49 | Path Weight: 5.00 50 | 1 -> 5: 51 | (1,0,4.00) -> (0,5,2.00) 52 | Path Weight: 6.00 53 | 2 -> 3: 54 | (2,3,6.00) 55 | Path Weight: 6.00 56 | 2 -> 4: 57 | (2,1,5.00) -> (1,4,5.00) 58 | Path Weight: 10.00 59 | 2 -> 5: 60 | (2,5,3.00) 61 | Path Weight: 3.00 62 | 3 -> 4: 63 | (3,4,7.00) 64 | Path Weight: 7.00 65 | 3 -> 5: 66 | (3,2,6.00) -> (2,5,3.00) 67 | Path Weight: 9.00 68 | 4 -> 5: 69 | (4,1,5.00) -> (1,0,4.00) -> (0,5,2.00) 70 | Path Weight: 11.00 71 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output047.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 5.000) 3 | (0, 2, 2.300) 4 | (0, 3, 5.000) 5 | (0, 4, 4.200) 6 | (1, 2, 4.500) 7 | (1, 3, 6.000) 8 | (2, 3, 3.900) 9 | (2, 4, 34.000) 10 | 11 | Depth First Traversal (vertex visited order): 12 | [0, 1, 2, 3, 4] 13 | 14 | Breadth First Traversal (lowest-weight-next): 15 | [0, 2, 4, 1, 3] 16 | 17 | Minimum Spanning Tree: 18 | (0, 2, 2.300) 19 | (0, 4, 4.200) 20 | (1, 2, 4.500) 21 | (2, 3, 3.900) 22 | Type: Full Spanning Tree 23 | Total Weight: 14.900 24 | 25 | Shortest Paths: 26 | 0 -> 1: 27 | (0,1,5.00) 28 | Path Weight: 5.00 29 | 0 -> 2: 30 | (0,2,2.30) 31 | Path Weight: 2.30 32 | 0 -> 3: 33 | (0,3,5.00) 34 | Path Weight: 5.00 35 | 0 -> 4: 36 | (0,4,4.20) 37 | Path Weight: 4.20 38 | 1 -> 2: 39 | (1,2,4.50) 40 | Path Weight: 4.50 41 | 1 -> 3: 42 | (1,3,6.00) 43 | Path Weight: 6.00 44 | 1 -> 4: 45 | (1,0,5.00) -> (0,4,4.20) 46 | Path Weight: 9.20 47 | 2 -> 3: 48 | (2,3,3.90) 49 | Path Weight: 3.90 50 | 2 -> 4: 51 | (2,0,2.30) -> (0,4,4.20) 52 | Path Weight: 6.50 53 | 3 -> 4: 54 | (3,0,5.00) -> (0,4,4.20) 55 | Path Weight: 9.20 56 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output048.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 4, 3.000) 3 | (0, 5, 6.000) 4 | (1, 2, 7.000) 5 | (1, 3, 1.000) 6 | (1, 4, 8.000) 7 | (2, 5, 3.000) 8 | (3, 5, 6.000) 9 | (4, 5, 9.000) 10 | (4, 8, 3.000) 11 | (4, 7, 1.000) 12 | (6, 7, 12.300) 13 | (7, 8, 3.300) 14 | 15 | Depth First Traversal (vertex visited order): 16 | [0, 4, 1, 2, 5, 3, 7, 6, 8] 17 | 18 | Breadth First Traversal (lowest-weight-next): 19 | [0, 4, 5, 7, 8, 1, 2, 3, 6] 20 | 21 | Minimum Spanning Tree: 22 | (0, 4, 3.000) 23 | (0, 5, 6.000) 24 | (1, 3, 1.000) 25 | (2, 5, 3.000) 26 | (3, 5, 6.000) 27 | (4, 8, 3.000) 28 | (4, 7, 1.000) 29 | (6, 7, 12.300) 30 | Type: Full Spanning Tree 31 | Total Weight: 35.300 32 | 33 | Shortest Paths: 34 | 0 -> 1: 35 | (0,4,3.00) -> (4,1,8.00) 36 | Path Weight: 11.00 37 | 0 -> 2: 38 | (0,5,6.00) -> (5,2,3.00) 39 | Path Weight: 9.00 40 | 0 -> 3: 41 | (0,5,6.00) -> (5,3,6.00) 42 | Path Weight: 12.00 43 | 0 -> 4: 44 | (0,4,3.00) 45 | Path Weight: 3.00 46 | 0 -> 5: 47 | (0,5,6.00) 48 | Path Weight: 6.00 49 | 0 -> 6: 50 | (0,4,3.00) -> (4,7,1.00) -> (7,6,12.30) 51 | Path Weight: 16.30 52 | 0 -> 7: 53 | (0,4,3.00) -> (4,7,1.00) 54 | Path Weight: 4.00 55 | 0 -> 8: 56 | (0,4,3.00) -> (4,8,3.00) 57 | Path Weight: 6.00 58 | 1 -> 2: 59 | (1,2,7.00) 60 | Path Weight: 7.00 61 | 1 -> 3: 62 | (1,3,1.00) 63 | Path Weight: 1.00 64 | 1 -> 4: 65 | (1,4,8.00) 66 | Path Weight: 8.00 67 | 1 -> 5: 68 | (1,3,1.00) -> (3,5,6.00) 69 | Path Weight: 7.00 70 | 1 -> 6: 71 | (1,4,8.00) -> (4,7,1.00) -> (7,6,12.30) 72 | Path Weight: 21.30 73 | 1 -> 7: 74 | (1,4,8.00) -> (4,7,1.00) 75 | Path Weight: 9.00 76 | 1 -> 8: 77 | (1,4,8.00) -> (4,8,3.00) 78 | Path Weight: 11.00 79 | 2 -> 3: 80 | (2,1,7.00) -> (1,3,1.00) 81 | Path Weight: 8.00 82 | 2 -> 4: 83 | (2,5,3.00) -> (5,4,9.00) 84 | Path Weight: 12.00 85 | 2 -> 5: 86 | (2,5,3.00) 87 | Path Weight: 3.00 88 | 2 -> 6: 89 | (2,5,3.00) -> (5,4,9.00) -> (4,7,1.00) -> (7,6,12.30) 90 | Path Weight: 25.30 91 | 2 -> 7: 92 | (2,5,3.00) -> (5,4,9.00) -> (4,7,1.00) 93 | Path Weight: 13.00 94 | 2 -> 8: 95 | (2,5,3.00) -> (5,4,9.00) -> (4,8,3.00) 96 | Path Weight: 15.00 97 | 3 -> 4: 98 | (3,1,1.00) -> (1,4,8.00) 99 | Path Weight: 9.00 100 | 3 -> 5: 101 | (3,5,6.00) 102 | Path Weight: 6.00 103 | 3 -> 6: 104 | (3,1,1.00) -> (1,4,8.00) -> (4,7,1.00) -> (7,6,12.30) 105 | Path Weight: 22.30 106 | 3 -> 7: 107 | (3,1,1.00) -> (1,4,8.00) -> (4,7,1.00) 108 | Path Weight: 10.00 109 | 3 -> 8: 110 | (3,1,1.00) -> (1,4,8.00) -> (4,8,3.00) 111 | Path Weight: 12.00 112 | 4 -> 5: 113 | (4,5,9.00) 114 | Path Weight: 9.00 115 | 4 -> 6: 116 | (4,7,1.00) -> (7,6,12.30) 117 | Path Weight: 13.30 118 | 4 -> 7: 119 | (4,7,1.00) 120 | Path Weight: 1.00 121 | 4 -> 8: 122 | (4,8,3.00) 123 | Path Weight: 3.00 124 | 5 -> 6: 125 | (5,4,9.00) -> (4,7,1.00) -> (7,6,12.30) 126 | Path Weight: 22.30 127 | 5 -> 7: 128 | (5,4,9.00) -> (4,7,1.00) 129 | Path Weight: 10.00 130 | 5 -> 8: 131 | (5,4,9.00) -> (4,8,3.00) 132 | Path Weight: 12.00 133 | 6 -> 7: 134 | (6,7,12.30) 135 | Path Weight: 12.30 136 | 6 -> 8: 137 | (6,7,12.30) -> (7,8,3.30) 138 | Path Weight: 15.60 139 | 7 -> 8: 140 | (7,8,3.30) 141 | Path Weight: 3.30 142 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output049.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 1.000) 3 | (1, 2, 1.000) 4 | (2, 3, 1.000) 5 | 6 | Depth First Traversal (vertex visited order): 7 | [0, 1, 2, 3] 8 | 9 | Breadth First Traversal (lowest-weight-next): 10 | [0, 1, 2, 3] 11 | 12 | Minimum Spanning Tree: 13 | (0, 1, 1.000) 14 | (1, 2, 1.000) 15 | (2, 3, 1.000) 16 | Type: Full Spanning Tree 17 | Total Weight: 3.000 18 | 19 | Shortest Paths: 20 | 0 -> 1: 21 | (0,1,1.00) 22 | Path Weight: 1.00 23 | 0 -> 2: 24 | (0,1,1.00) -> (1,2,1.00) 25 | Path Weight: 2.00 26 | 0 -> 3: 27 | (0,1,1.00) -> (1,2,1.00) -> (2,3,1.00) 28 | Path Weight: 3.00 29 | 1 -> 2: 30 | (1,2,1.00) 31 | Path Weight: 1.00 32 | 1 -> 3: 33 | (1,2,1.00) -> (2,3,1.00) 34 | Path Weight: 2.00 35 | 2 -> 3: 36 | (2,3,1.00) 37 | Path Weight: 1.00 38 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output051.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 3.000) 3 | (0, 2, 6.000) 4 | (0, 3, 4.000) 5 | (1, 2, 2.000) 6 | (1, 3, 10.000) 7 | (1, 4, 11.000) 8 | (2, 3, 7.000) 9 | (4, 5, 3.000) 10 | (5, 6, 7.000) 11 | (5, 7, 7.000) 12 | (6, 7, 15.000) 13 | 14 | Depth First Traversal (vertex visited order): 15 | [0, 1, 2, 3, 4, 5, 6, 7] 16 | 17 | Breadth First Traversal (lowest-weight-next): 18 | [0, 1, 3, 2, 4, 5, 6, 7] 19 | 20 | Minimum Spanning Tree: 21 | (0, 1, 3.000) 22 | (0, 3, 4.000) 23 | (1, 2, 2.000) 24 | (1, 4, 11.000) 25 | (4, 5, 3.000) 26 | (5, 6, 7.000) 27 | (5, 7, 7.000) 28 | Type: Full Spanning Tree 29 | Total Weight: 37.000 30 | 31 | Shortest Paths: 32 | 0 -> 1: 33 | (0,1,3.00) 34 | Path Weight: 3.00 35 | 0 -> 2: 36 | (0,1,3.00) -> (1,2,2.00) 37 | Path Weight: 5.00 38 | 0 -> 3: 39 | (0,3,4.00) 40 | Path Weight: 4.00 41 | 0 -> 4: 42 | (0,1,3.00) -> (1,4,11.00) 43 | Path Weight: 14.00 44 | 0 -> 5: 45 | (0,1,3.00) -> (1,4,11.00) -> (4,5,3.00) 46 | Path Weight: 17.00 47 | 0 -> 6: 48 | (0,1,3.00) -> (1,4,11.00) -> (4,5,3.00) -> (5,6,7.00) 49 | Path Weight: 24.00 50 | 0 -> 7: 51 | (0,1,3.00) -> (1,4,11.00) -> (4,5,3.00) -> (5,7,7.00) 52 | Path Weight: 24.00 53 | 1 -> 2: 54 | (1,2,2.00) 55 | Path Weight: 2.00 56 | 1 -> 3: 57 | (1,0,3.00) -> (0,3,4.00) 58 | Path Weight: 7.00 59 | 1 -> 4: 60 | (1,4,11.00) 61 | Path Weight: 11.00 62 | 1 -> 5: 63 | (1,4,11.00) -> (4,5,3.00) 64 | Path Weight: 14.00 65 | 1 -> 6: 66 | (1,4,11.00) -> (4,5,3.00) -> (5,6,7.00) 67 | Path Weight: 21.00 68 | 1 -> 7: 69 | (1,4,11.00) -> (4,5,3.00) -> (5,7,7.00) 70 | Path Weight: 21.00 71 | 2 -> 3: 72 | (2,3,7.00) 73 | Path Weight: 7.00 74 | 2 -> 4: 75 | (2,1,2.00) -> (1,4,11.00) 76 | Path Weight: 13.00 77 | 2 -> 5: 78 | (2,1,2.00) -> (1,4,11.00) -> (4,5,3.00) 79 | Path Weight: 16.00 80 | 2 -> 6: 81 | (2,1,2.00) -> (1,4,11.00) -> (4,5,3.00) -> (5,6,7.00) 82 | Path Weight: 23.00 83 | 2 -> 7: 84 | (2,1,2.00) -> (1,4,11.00) -> (4,5,3.00) -> (5,7,7.00) 85 | Path Weight: 23.00 86 | 3 -> 4: 87 | (3,0,4.00) -> (0,1,3.00) -> (1,4,11.00) 88 | Path Weight: 18.00 89 | 3 -> 5: 90 | (3,0,4.00) -> (0,1,3.00) -> (1,4,11.00) -> (4,5,3.00) 91 | Path Weight: 21.00 92 | 3 -> 6: 93 | (3,0,4.00) -> (0,1,3.00) -> (1,4,11.00) -> (4,5,3.00) -> (5,6,7.00) 94 | Path Weight: 28.00 95 | 3 -> 7: 96 | (3,0,4.00) -> (0,1,3.00) -> (1,4,11.00) -> (4,5,3.00) -> (5,7,7.00) 97 | Path Weight: 28.00 98 | 4 -> 5: 99 | (4,5,3.00) 100 | Path Weight: 3.00 101 | 4 -> 6: 102 | (4,5,3.00) -> (5,6,7.00) 103 | Path Weight: 10.00 104 | 4 -> 7: 105 | (4,5,3.00) -> (5,7,7.00) 106 | Path Weight: 10.00 107 | 5 -> 6: 108 | (5,6,7.00) 109 | Path Weight: 7.00 110 | 5 -> 7: 111 | (5,7,7.00) 112 | Path Weight: 7.00 113 | 6 -> 7: 114 | (6,5,7.00) -> (5,7,7.00) 115 | Path Weight: 14.00 116 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output052.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 3.000) 3 | (0, 2, 6.000) 4 | (0, 3, 4.000) 5 | (1, 2, 2.000) 6 | (1, 3, 10.000) 7 | (1, 4, 11.000) 8 | (2, 3, 7.000) 9 | (4, 5, 3.000) 10 | (5, 6, 15.000) 11 | (5, 7, 7.000) 12 | (6, 7, 7.000) 13 | (8, 9, 1.000) 14 | 15 | Depth First Traversal (vertex visited order): 16 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 17 | 18 | Breadth First Traversal (lowest-weight-next): 19 | [0, 1, 3, 2, 4, 5, 7, 6, 8, 9] 20 | 21 | Minimum Spanning Tree: 22 | (0, 1, 3.000) 23 | (0, 3, 4.000) 24 | (1, 2, 2.000) 25 | (1, 4, 11.000) 26 | (4, 5, 3.000) 27 | (5, 7, 7.000) 28 | (6, 7, 7.000) 29 | (8, 9, 1.000) 30 | Type: Spanning Forrest 31 | Total Weight: 38.000 32 | 33 | Shortest Paths: 34 | 0 -> 1: 35 | (0,1,3.00) 36 | Path Weight: 3.00 37 | 0 -> 2: 38 | (0,1,3.00) -> (1,2,2.00) 39 | Path Weight: 5.00 40 | 0 -> 3: 41 | (0,3,4.00) 42 | Path Weight: 4.00 43 | 0 -> 4: 44 | (0,1,3.00) -> (1,4,11.00) 45 | Path Weight: 14.00 46 | 0 -> 5: 47 | (0,1,3.00) -> (1,4,11.00) -> (4,5,3.00) 48 | Path Weight: 17.00 49 | 0 -> 6: 50 | (0,1,3.00) -> (1,4,11.00) -> (4,5,3.00) -> (5,7,7.00) -> (7,6,7.00) 51 | Path Weight: 31.00 52 | 0 -> 7: 53 | (0,1,3.00) -> (1,4,11.00) -> (4,5,3.00) -> (5,7,7.00) 54 | Path Weight: 24.00 55 | 0 -> 8: 56 | no path 57 | 0 -> 9: 58 | no path 59 | 1 -> 2: 60 | (1,2,2.00) 61 | Path Weight: 2.00 62 | 1 -> 3: 63 | (1,0,3.00) -> (0,3,4.00) 64 | Path Weight: 7.00 65 | 1 -> 4: 66 | (1,4,11.00) 67 | Path Weight: 11.00 68 | 1 -> 5: 69 | (1,4,11.00) -> (4,5,3.00) 70 | Path Weight: 14.00 71 | 1 -> 6: 72 | (1,4,11.00) -> (4,5,3.00) -> (5,7,7.00) -> (7,6,7.00) 73 | Path Weight: 28.00 74 | 1 -> 7: 75 | (1,4,11.00) -> (4,5,3.00) -> (5,7,7.00) 76 | Path Weight: 21.00 77 | 1 -> 8: 78 | no path 79 | 1 -> 9: 80 | no path 81 | 2 -> 3: 82 | (2,3,7.00) 83 | Path Weight: 7.00 84 | 2 -> 4: 85 | (2,1,2.00) -> (1,4,11.00) 86 | Path Weight: 13.00 87 | 2 -> 5: 88 | (2,1,2.00) -> (1,4,11.00) -> (4,5,3.00) 89 | Path Weight: 16.00 90 | 2 -> 6: 91 | (2,1,2.00) -> (1,4,11.00) -> (4,5,3.00) -> (5,7,7.00) -> (7,6,7.00) 92 | Path Weight: 30.00 93 | 2 -> 7: 94 | (2,1,2.00) -> (1,4,11.00) -> (4,5,3.00) -> (5,7,7.00) 95 | Path Weight: 23.00 96 | 2 -> 8: 97 | no path 98 | 2 -> 9: 99 | no path 100 | 3 -> 4: 101 | (3,0,4.00) -> (0,1,3.00) -> (1,4,11.00) 102 | Path Weight: 18.00 103 | 3 -> 5: 104 | (3,0,4.00) -> (0,1,3.00) -> (1,4,11.00) -> (4,5,3.00) 105 | Path Weight: 21.00 106 | 3 -> 6: 107 | (3,0,4.00) -> (0,1,3.00) -> (1,4,11.00) -> (4,5,3.00) -> (5,7,7.00) -> (7,6,7.00) 108 | Path Weight: 35.00 109 | 3 -> 7: 110 | (3,0,4.00) -> (0,1,3.00) -> (1,4,11.00) -> (4,5,3.00) -> (5,7,7.00) 111 | Path Weight: 28.00 112 | 3 -> 8: 113 | no path 114 | 3 -> 9: 115 | no path 116 | 4 -> 5: 117 | (4,5,3.00) 118 | Path Weight: 3.00 119 | 4 -> 6: 120 | (4,5,3.00) -> (5,7,7.00) -> (7,6,7.00) 121 | Path Weight: 17.00 122 | 4 -> 7: 123 | (4,5,3.00) -> (5,7,7.00) 124 | Path Weight: 10.00 125 | 4 -> 8: 126 | no path 127 | 4 -> 9: 128 | no path 129 | 5 -> 6: 130 | (5,7,7.00) -> (7,6,7.00) 131 | Path Weight: 14.00 132 | 5 -> 7: 133 | (5,7,7.00) 134 | Path Weight: 7.00 135 | 5 -> 8: 136 | no path 137 | 5 -> 9: 138 | no path 139 | 6 -> 7: 140 | (6,7,7.00) 141 | Path Weight: 7.00 142 | 6 -> 8: 143 | no path 144 | 6 -> 9: 145 | no path 146 | 7 -> 8: 147 | no path 148 | 7 -> 9: 149 | no path 150 | 8 -> 9: 151 | (8,9,1.00) 152 | Path Weight: 1.00 153 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output053.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 4.000) 3 | (0, 2, 2.000) 4 | (1, 2, 6.000) 5 | (1, 3, 3.000) 6 | (2, 3, 5.000) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 1, 2, 3] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 2, 1, 3] 13 | 14 | Minimum Spanning Tree: 15 | (0, 1, 4.000) 16 | (0, 2, 2.000) 17 | (1, 3, 3.000) 18 | Type: Full Spanning Tree 19 | Total Weight: 9.000 20 | 21 | Shortest Paths: 22 | 0 -> 1: 23 | (0,1,4.00) 24 | Path Weight: 4.00 25 | 0 -> 2: 26 | (0,2,2.00) 27 | Path Weight: 2.00 28 | 0 -> 3: 29 | (0,2,2.00) -> (2,3,5.00) 30 | Path Weight: 7.00 31 | 1 -> 2: 32 | (1,2,6.00) 33 | Path Weight: 6.00 34 | 1 -> 3: 35 | (1,3,3.00) 36 | Path Weight: 3.00 37 | 2 -> 3: 38 | (2,3,5.00) 39 | Path Weight: 5.00 40 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output054.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 2, 7.000) 3 | (1, 2, 3.000) 4 | (2, 3, 2.000) 5 | (2, 4, 1.000) 6 | (3, 4, 2.000) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 2, 1, 3, 4] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 2, 4, 3, 1] 13 | 14 | Minimum Spanning Tree: 15 | (0, 2, 7.000) 16 | (1, 2, 3.000) 17 | (2, 3, 2.000) 18 | (2, 4, 1.000) 19 | Type: Full Spanning Tree 20 | Total Weight: 13.000 21 | 22 | Shortest Paths: 23 | 0 -> 1: 24 | (0,2,7.00) -> (2,1,3.00) 25 | Path Weight: 10.00 26 | 0 -> 2: 27 | (0,2,7.00) 28 | Path Weight: 7.00 29 | 0 -> 3: 30 | (0,2,7.00) -> (2,3,2.00) 31 | Path Weight: 9.00 32 | 0 -> 4: 33 | (0,2,7.00) -> (2,4,1.00) 34 | Path Weight: 8.00 35 | 1 -> 2: 36 | (1,2,3.00) 37 | Path Weight: 3.00 38 | 1 -> 3: 39 | (1,2,3.00) -> (2,3,2.00) 40 | Path Weight: 5.00 41 | 1 -> 4: 42 | (1,2,3.00) -> (2,4,1.00) 43 | Path Weight: 4.00 44 | 2 -> 3: 45 | (2,3,2.00) 46 | Path Weight: 2.00 47 | 2 -> 4: 48 | (2,4,1.00) 49 | Path Weight: 1.00 50 | 3 -> 4: 51 | (3,4,2.00) 52 | Path Weight: 2.00 53 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output055.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 19.000) 3 | (0, 2, 2.000) 4 | (0, 4, 7.600) 5 | (1, 2, 5.100) 6 | (1, 3, 9.900) 7 | (1, 4, 20.000) 8 | (2, 3, 2.300) 9 | (2, 4, 6.600) 10 | (3, 4, 7.800) 11 | 12 | Depth First Traversal (vertex visited order): 13 | [0, 1, 2, 3, 4] 14 | 15 | Breadth First Traversal (lowest-weight-next): 16 | [0, 2, 4, 1, 3] 17 | 18 | Minimum Spanning Tree: 19 | (0, 2, 2.000) 20 | (1, 2, 5.100) 21 | (2, 3, 2.300) 22 | (2, 4, 6.600) 23 | Type: Full Spanning Tree 24 | Total Weight: 16.000 25 | 26 | Shortest Paths: 27 | 0 -> 1: 28 | (0,2,2.00) -> (2,1,5.10) 29 | Path Weight: 7.10 30 | 0 -> 2: 31 | (0,2,2.00) 32 | Path Weight: 2.00 33 | 0 -> 3: 34 | (0,2,2.00) -> (2,3,2.30) 35 | Path Weight: 4.30 36 | 0 -> 4: 37 | (0,4,7.60) 38 | Path Weight: 7.60 39 | 1 -> 2: 40 | (1,2,5.10) 41 | Path Weight: 5.10 42 | 1 -> 3: 43 | (1,2,5.10) -> (2,3,2.30) 44 | Path Weight: 7.40 45 | 1 -> 4: 46 | (1,2,5.10) -> (2,4,6.60) 47 | Path Weight: 11.70 48 | 2 -> 3: 49 | (2,3,2.30) 50 | Path Weight: 2.30 51 | 2 -> 4: 52 | (2,4,6.60) 53 | Path Weight: 6.60 54 | 3 -> 4: 55 | (3,4,7.80) 56 | Path Weight: 7.80 57 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output056.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 1.000) 3 | (0, 2, 3.000) 4 | (0, 3, 8.000) 5 | (1, 2, 7.300) 6 | (1, 3, 21.200) 7 | (2, 3, 8.450) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 1, 2, 3] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 1, 2, 3] 14 | 15 | Minimum Spanning Tree: 16 | (0, 1, 1.000) 17 | (0, 2, 3.000) 18 | (0, 3, 8.000) 19 | Type: Full Spanning Tree 20 | Total Weight: 12.000 21 | 22 | Shortest Paths: 23 | 0 -> 1: 24 | (0,1,1.00) 25 | Path Weight: 1.00 26 | 0 -> 2: 27 | (0,2,3.00) 28 | Path Weight: 3.00 29 | 0 -> 3: 30 | (0,3,8.00) 31 | Path Weight: 8.00 32 | 1 -> 2: 33 | (1,0,1.00) -> (0,2,3.00) 34 | Path Weight: 4.00 35 | 1 -> 3: 36 | (1,0,1.00) -> (0,3,8.00) 37 | Path Weight: 9.00 38 | 2 -> 3: 39 | (2,3,8.45) 40 | Path Weight: 8.45 41 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output057.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 0.500) 3 | (0, 2, 15.100) 4 | (1, 2, 13.200) 5 | (2, 3, 10.500) 6 | (3, 4, 20.500) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 1, 2, 3, 4] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 1, 2, 3, 4] 13 | 14 | Minimum Spanning Tree: 15 | (0, 1, 0.500) 16 | (1, 2, 13.200) 17 | (2, 3, 10.500) 18 | (3, 4, 20.500) 19 | Type: Full Spanning Tree 20 | Total Weight: 44.700 21 | 22 | Shortest Paths: 23 | 0 -> 1: 24 | (0,1,0.50) 25 | Path Weight: 0.50 26 | 0 -> 2: 27 | (0,1,0.50) -> (1,2,13.20) 28 | Path Weight: 13.70 29 | 0 -> 3: 30 | (0,1,0.50) -> (1,2,13.20) -> (2,3,10.50) 31 | Path Weight: 24.20 32 | 0 -> 4: 33 | (0,1,0.50) -> (1,2,13.20) -> (2,3,10.50) -> (3,4,20.50) 34 | Path Weight: 44.70 35 | 1 -> 2: 36 | (1,2,13.20) 37 | Path Weight: 13.20 38 | 1 -> 3: 39 | (1,2,13.20) -> (2,3,10.50) 40 | Path Weight: 23.70 41 | 1 -> 4: 42 | (1,2,13.20) -> (2,3,10.50) -> (3,4,20.50) 43 | Path Weight: 44.20 44 | 2 -> 3: 45 | (2,3,10.50) 46 | Path Weight: 10.50 47 | 2 -> 4: 48 | (2,3,10.50) -> (3,4,20.50) 49 | Path Weight: 31.00 50 | 3 -> 4: 51 | (3,4,20.50) 52 | Path Weight: 20.50 53 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output058.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 4, 3.000) 3 | (1, 2, 1.000) 4 | (1, 3, 2.000) 5 | (1, 4, 2.000) 6 | (2, 4, 5.000) 7 | (3, 4, 7.000) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 4, 1, 2, 3] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 4, 1, 2, 3] 14 | 15 | Minimum Spanning Tree: 16 | (0, 4, 3.000) 17 | (1, 2, 1.000) 18 | (1, 3, 2.000) 19 | (1, 4, 2.000) 20 | Type: Full Spanning Tree 21 | Total Weight: 8.000 22 | 23 | Shortest Paths: 24 | 0 -> 1: 25 | (0,4,3.00) -> (4,1,2.00) 26 | Path Weight: 5.00 27 | 0 -> 2: 28 | (0,4,3.00) -> (4,1,2.00) -> (1,2,1.00) 29 | Path Weight: 6.00 30 | 0 -> 3: 31 | (0,4,3.00) -> (4,1,2.00) -> (1,3,2.00) 32 | Path Weight: 7.00 33 | 0 -> 4: 34 | (0,4,3.00) 35 | Path Weight: 3.00 36 | 1 -> 2: 37 | (1,2,1.00) 38 | Path Weight: 1.00 39 | 1 -> 3: 40 | (1,3,2.00) 41 | Path Weight: 2.00 42 | 1 -> 4: 43 | (1,4,2.00) 44 | Path Weight: 2.00 45 | 2 -> 3: 46 | (2,1,1.00) -> (1,3,2.00) 47 | Path Weight: 3.00 48 | 2 -> 4: 49 | (2,1,1.00) -> (1,4,2.00) 50 | Path Weight: 3.00 51 | 3 -> 4: 52 | (3,1,2.00) -> (1,4,2.00) 53 | Path Weight: 4.00 54 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output059.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 2, 1.400) 3 | (1, 2, 3.000) 4 | (2, 3, 2.500) 5 | (2, 4, 4.200) 6 | (3, 4, 3.100) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 2, 1, 3, 4] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 2, 3, 1, 4] 13 | 14 | Minimum Spanning Tree: 15 | (0, 2, 1.400) 16 | (1, 2, 3.000) 17 | (2, 3, 2.500) 18 | (3, 4, 3.100) 19 | Type: Full Spanning Tree 20 | Total Weight: 10.000 21 | 22 | Shortest Paths: 23 | 0 -> 1: 24 | (0,2,1.40) -> (2,1,3.00) 25 | Path Weight: 4.40 26 | 0 -> 2: 27 | (0,2,1.40) 28 | Path Weight: 1.40 29 | 0 -> 3: 30 | (0,2,1.40) -> (2,3,2.50) 31 | Path Weight: 3.90 32 | 0 -> 4: 33 | (0,2,1.40) -> (2,4,4.20) 34 | Path Weight: 5.60 35 | 1 -> 2: 36 | (1,2,3.00) 37 | Path Weight: 3.00 38 | 1 -> 3: 39 | (1,2,3.00) -> (2,3,2.50) 40 | Path Weight: 5.50 41 | 1 -> 4: 42 | (1,2,3.00) -> (2,4,4.20) 43 | Path Weight: 7.20 44 | 2 -> 3: 45 | (2,3,2.50) 46 | Path Weight: 2.50 47 | 2 -> 4: 48 | (2,4,4.20) 49 | Path Weight: 4.20 50 | 3 -> 4: 51 | (3,4,3.10) 52 | Path Weight: 3.10 53 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output060.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 3.000) 3 | (0, 2, 4.000) 4 | (1, 2, 1.000) 5 | (2, 3, 2.000) 6 | (2, 4, 5.000) 7 | (3, 4, 6.000) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 1, 2, 3, 4] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 1, 2, 3, 4] 14 | 15 | Minimum Spanning Tree: 16 | (0, 1, 3.000) 17 | (1, 2, 1.000) 18 | (2, 3, 2.000) 19 | (2, 4, 5.000) 20 | Type: Full Spanning Tree 21 | Total Weight: 11.000 22 | 23 | Shortest Paths: 24 | 0 -> 1: 25 | (0,1,3.00) 26 | Path Weight: 3.00 27 | 0 -> 2: 28 | (0,2,4.00) 29 | Path Weight: 4.00 30 | 0 -> 3: 31 | (0,2,4.00) -> (2,3,2.00) 32 | Path Weight: 6.00 33 | 0 -> 4: 34 | (0,2,4.00) -> (2,4,5.00) 35 | Path Weight: 9.00 36 | 1 -> 2: 37 | (1,2,1.00) 38 | Path Weight: 1.00 39 | 1 -> 3: 40 | (1,2,1.00) -> (2,3,2.00) 41 | Path Weight: 3.00 42 | 1 -> 4: 43 | (1,2,1.00) -> (2,4,5.00) 44 | Path Weight: 6.00 45 | 2 -> 3: 46 | (2,3,2.00) 47 | Path Weight: 2.00 48 | 2 -> 4: 49 | (2,4,5.00) 50 | Path Weight: 5.00 51 | 3 -> 4: 52 | (3,4,6.00) 53 | Path Weight: 6.00 54 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output061.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 1.000) 3 | (0, 2, 1.000) 4 | (0, 3, 3.000) 5 | (1, 2, 5.000) 6 | (1, 3, 1.000) 7 | (2, 3, 2.000) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 1, 2, 3] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 1, 2, 3] 14 | 15 | Minimum Spanning Tree: 16 | (0, 1, 1.000) 17 | (0, 2, 1.000) 18 | (1, 3, 1.000) 19 | Type: Full Spanning Tree 20 | Total Weight: 3.000 21 | 22 | Shortest Paths: 23 | 0 -> 1: 24 | (0,1,1.00) 25 | Path Weight: 1.00 26 | 0 -> 2: 27 | (0,2,1.00) 28 | Path Weight: 1.00 29 | 0 -> 3: 30 | (0,1,1.00) -> (1,3,1.00) 31 | Path Weight: 2.00 32 | 1 -> 2: 33 | (1,0,1.00) -> (0,2,1.00) 34 | Path Weight: 2.00 35 | 1 -> 3: 36 | (1,3,1.00) 37 | Path Weight: 1.00 38 | 2 -> 3: 39 | (2,3,2.00) 40 | Path Weight: 2.00 41 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output062.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 0.100) 3 | (0, 2, 0.200) 4 | (1, 2, 0.250) 5 | (3, 4, 0.500) 6 | (3, 5, 1.000) 7 | (4, 5, 0.250) 8 | 9 | Depth First Traversal (vertex visited order): 10 | [0, 1, 2, 3, 4, 5] 11 | 12 | Breadth First Traversal (lowest-weight-next): 13 | [0, 1, 2, 3, 4, 5] 14 | 15 | Minimum Spanning Tree: 16 | (0, 1, 0.100) 17 | (0, 2, 0.200) 18 | (3, 4, 0.500) 19 | (4, 5, 0.250) 20 | Type: Spanning Forrest 21 | Total Weight: 1.050 22 | 23 | Shortest Paths: 24 | 0 -> 1: 25 | (0,1,0.10) 26 | Path Weight: 0.10 27 | 0 -> 2: 28 | (0,2,0.20) 29 | Path Weight: 0.20 30 | 0 -> 3: 31 | no path 32 | 0 -> 4: 33 | no path 34 | 0 -> 5: 35 | no path 36 | 1 -> 2: 37 | (1,2,0.25) 38 | Path Weight: 0.25 39 | 1 -> 3: 40 | no path 41 | 1 -> 4: 42 | no path 43 | 1 -> 5: 44 | no path 45 | 2 -> 3: 46 | no path 47 | 2 -> 4: 48 | no path 49 | 2 -> 5: 50 | no path 51 | 3 -> 4: 52 | (3,4,0.50) 53 | Path Weight: 0.50 54 | 3 -> 5: 55 | (3,4,0.50) -> (4,5,0.25) 56 | Path Weight: 0.75 57 | 4 -> 5: 58 | (4,5,0.25) 59 | Path Weight: 0.25 60 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output063.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 3.000) 3 | (0, 2, 5.400) 4 | (0, 3, 3.100) 5 | (0, 4, 0.300) 6 | (0, 5, 10.000) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 1, 2, 3, 4, 5] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 4, 1, 3, 2, 5] 13 | 14 | Minimum Spanning Tree: 15 | (0, 1, 3.000) 16 | (0, 2, 5.400) 17 | (0, 3, 3.100) 18 | (0, 4, 0.300) 19 | (0, 5, 10.000) 20 | Type: Full Spanning Tree 21 | Total Weight: 21.800 22 | 23 | Shortest Paths: 24 | 0 -> 1: 25 | (0,1,3.00) 26 | Path Weight: 3.00 27 | 0 -> 2: 28 | (0,2,5.40) 29 | Path Weight: 5.40 30 | 0 -> 3: 31 | (0,3,3.10) 32 | Path Weight: 3.10 33 | 0 -> 4: 34 | (0,4,0.30) 35 | Path Weight: 0.30 36 | 0 -> 5: 37 | (0,5,10.00) 38 | Path Weight: 10.00 39 | 1 -> 2: 40 | (1,0,3.00) -> (0,2,5.40) 41 | Path Weight: 8.40 42 | 1 -> 3: 43 | (1,0,3.00) -> (0,3,3.10) 44 | Path Weight: 6.10 45 | 1 -> 4: 46 | (1,0,3.00) -> (0,4,0.30) 47 | Path Weight: 3.30 48 | 1 -> 5: 49 | (1,0,3.00) -> (0,5,10.00) 50 | Path Weight: 13.00 51 | 2 -> 3: 52 | (2,0,5.40) -> (0,3,3.10) 53 | Path Weight: 8.50 54 | 2 -> 4: 55 | (2,0,5.40) -> (0,4,0.30) 56 | Path Weight: 5.70 57 | 2 -> 5: 58 | (2,0,5.40) -> (0,5,10.00) 59 | Path Weight: 15.40 60 | 3 -> 4: 61 | (3,0,3.10) -> (0,4,0.30) 62 | Path Weight: 3.40 63 | 3 -> 5: 64 | (3,0,3.10) -> (0,5,10.00) 65 | Path Weight: 13.10 66 | 4 -> 5: 67 | (4,0,0.30) -> (0,5,10.00) 68 | Path Weight: 10.30 69 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output064.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 5.000) 3 | (0, 2, 2.500) 4 | (0, 3, 7.500) 5 | (1, 3, 2.500) 6 | (1, 5, 7.500) 7 | (2, 3, 5.000) 8 | (2, 4, 2.500) 9 | (4, 5, 1.000) 10 | 11 | Depth First Traversal (vertex visited order): 12 | [0, 1, 3, 2, 4, 5] 13 | 14 | Breadth First Traversal (lowest-weight-next): 15 | [0, 2, 1, 3, 4, 5] 16 | 17 | Minimum Spanning Tree: 18 | (0, 1, 5.000) 19 | (0, 2, 2.500) 20 | (1, 3, 2.500) 21 | (2, 4, 2.500) 22 | (4, 5, 1.000) 23 | Type: Full Spanning Tree 24 | Total Weight: 13.500 25 | 26 | Shortest Paths: 27 | 0 -> 1: 28 | (0,1,5.00) 29 | Path Weight: 5.00 30 | 0 -> 2: 31 | (0,2,2.50) 32 | Path Weight: 2.50 33 | 0 -> 3: 34 | (0,3,7.50) 35 | Path Weight: 7.50 36 | 0 -> 4: 37 | (0,2,2.50) -> (2,4,2.50) 38 | Path Weight: 5.00 39 | 0 -> 5: 40 | (0,2,2.50) -> (2,4,2.50) -> (4,5,1.00) 41 | Path Weight: 6.00 42 | 1 -> 2: 43 | (1,3,2.50) -> (3,2,5.00) 44 | Path Weight: 7.50 45 | 1 -> 3: 46 | (1,3,2.50) 47 | Path Weight: 2.50 48 | 1 -> 4: 49 | (1,5,7.50) -> (5,4,1.00) 50 | Path Weight: 8.50 51 | 1 -> 5: 52 | (1,5,7.50) 53 | Path Weight: 7.50 54 | 2 -> 3: 55 | (2,3,5.00) 56 | Path Weight: 5.00 57 | 2 -> 4: 58 | (2,4,2.50) 59 | Path Weight: 2.50 60 | 2 -> 5: 61 | (2,4,2.50) -> (4,5,1.00) 62 | Path Weight: 3.50 63 | 3 -> 4: 64 | (3,2,5.00) -> (2,4,2.50) 65 | Path Weight: 7.50 66 | 3 -> 5: 67 | (3,2,5.00) -> (2,4,2.50) -> (4,5,1.00) 68 | Path Weight: 8.50 69 | 4 -> 5: 70 | (4,5,1.00) 71 | Path Weight: 1.00 72 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output065.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 3, 1.000) 3 | (0, 4, 2.000) 4 | (1, 2, 3.000) 5 | (1, 4, 1.000) 6 | (2, 3, 2.000) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 3, 2, 1, 4] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 3, 4, 2, 1] 13 | 14 | Minimum Spanning Tree: 15 | (0, 3, 1.000) 16 | (0, 4, 2.000) 17 | (1, 4, 1.000) 18 | (2, 3, 2.000) 19 | Type: Full Spanning Tree 20 | Total Weight: 6.000 21 | 22 | Shortest Paths: 23 | 0 -> 1: 24 | (0,4,2.00) -> (4,1,1.00) 25 | Path Weight: 3.00 26 | 0 -> 2: 27 | (0,3,1.00) -> (3,2,2.00) 28 | Path Weight: 3.00 29 | 0 -> 3: 30 | (0,3,1.00) 31 | Path Weight: 1.00 32 | 0 -> 4: 33 | (0,4,2.00) 34 | Path Weight: 2.00 35 | 1 -> 2: 36 | (1,2,3.00) 37 | Path Weight: 3.00 38 | 1 -> 3: 39 | (1,4,1.00) -> (4,0,2.00) -> (0,3,1.00) 40 | Path Weight: 4.00 41 | 1 -> 4: 42 | (1,4,1.00) 43 | Path Weight: 1.00 44 | 2 -> 3: 45 | (2,3,2.00) 46 | Path Weight: 2.00 47 | 2 -> 4: 48 | (2,1,3.00) -> (1,4,1.00) 49 | Path Weight: 4.00 50 | 3 -> 4: 51 | (3,0,1.00) -> (0,4,2.00) 52 | Path Weight: 3.00 53 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output066.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 3.000) 3 | (0, 2, 6.500) 4 | (0, 3, 4.300) 5 | (1, 2, 11.000) 6 | (2, 3, 2.500) 7 | (2, 4, 6.000) 8 | (3, 4, 10.300) 9 | 10 | Depth First Traversal (vertex visited order): 11 | [0, 1, 2, 3, 4] 12 | 13 | Breadth First Traversal (lowest-weight-next): 14 | [0, 1, 3, 2, 4] 15 | 16 | Minimum Spanning Tree: 17 | (0, 1, 3.000) 18 | (0, 3, 4.300) 19 | (2, 3, 2.500) 20 | (2, 4, 6.000) 21 | Type: Full Spanning Tree 22 | Total Weight: 15.800 23 | 24 | Shortest Paths: 25 | 0 -> 1: 26 | (0,1,3.00) 27 | Path Weight: 3.00 28 | 0 -> 2: 29 | (0,2,6.50) 30 | Path Weight: 6.50 31 | 0 -> 3: 32 | (0,3,4.30) 33 | Path Weight: 4.30 34 | 0 -> 4: 35 | (0,2,6.50) -> (2,4,6.00) 36 | Path Weight: 12.50 37 | 1 -> 2: 38 | (1,0,3.00) -> (0,2,6.50) 39 | Path Weight: 9.50 40 | 1 -> 3: 41 | (1,0,3.00) -> (0,3,4.30) 42 | Path Weight: 7.30 43 | 1 -> 4: 44 | (1,0,3.00) -> (0,2,6.50) -> (2,4,6.00) 45 | Path Weight: 15.50 46 | 2 -> 3: 47 | (2,3,2.50) 48 | Path Weight: 2.50 49 | 2 -> 4: 50 | (2,4,6.00) 51 | Path Weight: 6.00 52 | 3 -> 4: 53 | (3,2,2.50) -> (2,4,6.00) 54 | Path Weight: 8.50 55 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output067.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 2, 3.000) 3 | (0, 3, 6.500) 4 | (0, 5, 4.300) 5 | (1, 2, 4.200) 6 | (2, 4, 2.500) 7 | (2, 6, 5.000) 8 | (3, 4, 10.300) 9 | (5, 6, 7.980) 10 | 11 | Depth First Traversal (vertex visited order): 12 | [0, 2, 1, 4, 3, 6, 5] 13 | 14 | Breadth First Traversal (lowest-weight-next): 15 | [0, 2, 5, 3, 4, 1, 6] 16 | 17 | Minimum Spanning Tree: 18 | (0, 2, 3.000) 19 | (0, 3, 6.500) 20 | (0, 5, 4.300) 21 | (1, 2, 4.200) 22 | (2, 4, 2.500) 23 | (2, 6, 5.000) 24 | Type: Full Spanning Tree 25 | Total Weight: 25.500 26 | 27 | Shortest Paths: 28 | 0 -> 1: 29 | (0,2,3.00) -> (2,1,4.20) 30 | Path Weight: 7.20 31 | 0 -> 2: 32 | (0,2,3.00) 33 | Path Weight: 3.00 34 | 0 -> 3: 35 | (0,3,6.50) 36 | Path Weight: 6.50 37 | 0 -> 4: 38 | (0,2,3.00) -> (2,4,2.50) 39 | Path Weight: 5.50 40 | 0 -> 5: 41 | (0,5,4.30) 42 | Path Weight: 4.30 43 | 0 -> 6: 44 | (0,2,3.00) -> (2,6,5.00) 45 | Path Weight: 8.00 46 | 1 -> 2: 47 | (1,2,4.20) 48 | Path Weight: 4.20 49 | 1 -> 3: 50 | (1,2,4.20) -> (2,0,3.00) -> (0,3,6.50) 51 | Path Weight: 13.70 52 | 1 -> 4: 53 | (1,2,4.20) -> (2,4,2.50) 54 | Path Weight: 6.70 55 | 1 -> 5: 56 | (1,2,4.20) -> (2,0,3.00) -> (0,5,4.30) 57 | Path Weight: 11.50 58 | 1 -> 6: 59 | (1,2,4.20) -> (2,6,5.00) 60 | Path Weight: 9.20 61 | 2 -> 3: 62 | (2,0,3.00) -> (0,3,6.50) 63 | Path Weight: 9.50 64 | 2 -> 4: 65 | (2,4,2.50) 66 | Path Weight: 2.50 67 | 2 -> 5: 68 | (2,0,3.00) -> (0,5,4.30) 69 | Path Weight: 7.30 70 | 2 -> 6: 71 | (2,6,5.00) 72 | Path Weight: 5.00 73 | 3 -> 4: 74 | (3,4,10.30) 75 | Path Weight: 10.30 76 | 3 -> 5: 77 | (3,0,6.50) -> (0,5,4.30) 78 | Path Weight: 10.80 79 | 3 -> 6: 80 | (3,0,6.50) -> (0,2,3.00) -> (2,6,5.00) 81 | Path Weight: 14.50 82 | 4 -> 5: 83 | (4,2,2.50) -> (2,0,3.00) -> (0,5,4.30) 84 | Path Weight: 9.80 85 | 4 -> 6: 86 | (4,2,2.50) -> (2,6,5.00) 87 | Path Weight: 7.50 88 | 5 -> 6: 89 | (5,6,7.98) 90 | Path Weight: 7.98 91 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output068.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 2, 7.700) 3 | (1, 4, 2.100) 4 | (2, 3, 1.000) 5 | (2, 4, 4.200) 6 | (3, 4, 1.800) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 2, 3, 4, 1] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 2, 3, 4, 1] 13 | 14 | Minimum Spanning Tree: 15 | (0, 2, 7.700) 16 | (1, 4, 2.100) 17 | (2, 3, 1.000) 18 | (3, 4, 1.800) 19 | Type: Full Spanning Tree 20 | Total Weight: 12.600 21 | 22 | Shortest Paths: 23 | 0 -> 1: 24 | (0,2,7.70) -> (2,3,1.00) -> (3,4,1.80) -> (4,1,2.10) 25 | Path Weight: 12.60 26 | 0 -> 2: 27 | (0,2,7.70) 28 | Path Weight: 7.70 29 | 0 -> 3: 30 | (0,2,7.70) -> (2,3,1.00) 31 | Path Weight: 8.70 32 | 0 -> 4: 33 | (0,2,7.70) -> (2,3,1.00) -> (3,4,1.80) 34 | Path Weight: 10.50 35 | 1 -> 2: 36 | (1,4,2.10) -> (4,3,1.80) -> (3,2,1.00) 37 | Path Weight: 4.90 38 | 1 -> 3: 39 | (1,4,2.10) -> (4,3,1.80) 40 | Path Weight: 3.90 41 | 1 -> 4: 42 | (1,4,2.10) 43 | Path Weight: 2.10 44 | 2 -> 3: 45 | (2,3,1.00) 46 | Path Weight: 1.00 47 | 2 -> 4: 48 | (2,3,1.00) -> (3,4,1.80) 49 | Path Weight: 2.80 50 | 3 -> 4: 51 | (3,4,1.80) 52 | Path Weight: 1.80 53 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output069.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 1.000) 3 | (1, 2, 4.300) 4 | (2, 3, 2.200) 5 | (2, 5, 3.200) 6 | (3, 4, 1.800) 7 | (4, 5, 1.000) 8 | (4, 6, 7.200) 9 | 10 | Depth First Traversal (vertex visited order): 11 | [0, 1, 2, 3, 4, 5, 6] 12 | 13 | Breadth First Traversal (lowest-weight-next): 14 | [0, 1, 2, 3, 5, 4, 6] 15 | 16 | Minimum Spanning Tree: 17 | (0, 1, 1.000) 18 | (1, 2, 4.300) 19 | (2, 3, 2.200) 20 | (3, 4, 1.800) 21 | (4, 5, 1.000) 22 | (4, 6, 7.200) 23 | Type: Full Spanning Tree 24 | Total Weight: 17.500 25 | 26 | Shortest Paths: 27 | 0 -> 1: 28 | (0,1,1.00) 29 | Path Weight: 1.00 30 | 0 -> 2: 31 | (0,1,1.00) -> (1,2,4.30) 32 | Path Weight: 5.30 33 | 0 -> 3: 34 | (0,1,1.00) -> (1,2,4.30) -> (2,3,2.20) 35 | Path Weight: 7.50 36 | 0 -> 4: 37 | (0,1,1.00) -> (1,2,4.30) -> (2,3,2.20) -> (3,4,1.80) 38 | Path Weight: 9.30 39 | 0 -> 5: 40 | (0,1,1.00) -> (1,2,4.30) -> (2,5,3.20) 41 | Path Weight: 8.50 42 | 0 -> 6: 43 | (0,1,1.00) -> (1,2,4.30) -> (2,3,2.20) -> (3,4,1.80) -> (4,6,7.20) 44 | Path Weight: 16.50 45 | 1 -> 2: 46 | (1,2,4.30) 47 | Path Weight: 4.30 48 | 1 -> 3: 49 | (1,2,4.30) -> (2,3,2.20) 50 | Path Weight: 6.50 51 | 1 -> 4: 52 | (1,2,4.30) -> (2,3,2.20) -> (3,4,1.80) 53 | Path Weight: 8.30 54 | 1 -> 5: 55 | (1,2,4.30) -> (2,5,3.20) 56 | Path Weight: 7.50 57 | 1 -> 6: 58 | (1,2,4.30) -> (2,3,2.20) -> (3,4,1.80) -> (4,6,7.20) 59 | Path Weight: 15.50 60 | 2 -> 3: 61 | (2,3,2.20) 62 | Path Weight: 2.20 63 | 2 -> 4: 64 | (2,3,2.20) -> (3,4,1.80) 65 | Path Weight: 4.00 66 | 2 -> 5: 67 | (2,5,3.20) 68 | Path Weight: 3.20 69 | 2 -> 6: 70 | (2,3,2.20) -> (3,4,1.80) -> (4,6,7.20) 71 | Path Weight: 11.20 72 | 3 -> 4: 73 | (3,4,1.80) 74 | Path Weight: 1.80 75 | 3 -> 5: 76 | (3,4,1.80) -> (4,5,1.00) 77 | Path Weight: 2.80 78 | 3 -> 6: 79 | (3,4,1.80) -> (4,6,7.20) 80 | Path Weight: 9.00 81 | 4 -> 5: 82 | (4,5,1.00) 83 | Path Weight: 1.00 84 | 4 -> 6: 85 | (4,6,7.20) 86 | Path Weight: 7.20 87 | 5 -> 6: 88 | (5,4,1.00) -> (4,6,7.20) 89 | Path Weight: 8.20 90 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output070.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 2.000) 3 | (0, 7, 4.000) 4 | (1, 8, 8.200) 5 | (1, 2, 3.300) 6 | (2, 3, 9.000) 7 | (2, 4, 1.100) 8 | (2, 5, 2.700) 9 | (3, 7, 3.400) 10 | (4, 6, 5.000) 11 | (4, 7, 3.000) 12 | (5, 8, 4.700) 13 | (5, 6, 5.800) 14 | 15 | Depth First Traversal (vertex visited order): 16 | [0, 1, 2, 3, 7, 4, 6, 5, 8] 17 | 18 | Breadth First Traversal (lowest-weight-next): 19 | [0, 1, 7, 2, 8, 4, 3, 5, 6] 20 | 21 | Minimum Spanning Tree: 22 | (0, 1, 2.000) 23 | (1, 2, 3.300) 24 | (2, 4, 1.100) 25 | (2, 5, 2.700) 26 | (3, 7, 3.400) 27 | (4, 6, 5.000) 28 | (4, 7, 3.000) 29 | (5, 8, 4.700) 30 | Type: Full Spanning Tree 31 | Total Weight: 25.200 32 | 33 | Shortest Paths: 34 | 0 -> 1: 35 | (0,1,2.00) 36 | Path Weight: 2.00 37 | 0 -> 2: 38 | (0,1,2.00) -> (1,2,3.30) 39 | Path Weight: 5.30 40 | 0 -> 3: 41 | (0,7,4.00) -> (7,3,3.40) 42 | Path Weight: 7.40 43 | 0 -> 4: 44 | (0,1,2.00) -> (1,2,3.30) -> (2,4,1.10) 45 | Path Weight: 6.40 46 | 0 -> 5: 47 | (0,1,2.00) -> (1,2,3.30) -> (2,5,2.70) 48 | Path Weight: 8.00 49 | 0 -> 6: 50 | (0,1,2.00) -> (1,2,3.30) -> (2,4,1.10) -> (4,6,5.00) 51 | Path Weight: 11.40 52 | 0 -> 7: 53 | (0,7,4.00) 54 | Path Weight: 4.00 55 | 0 -> 8: 56 | (0,1,2.00) -> (1,8,8.20) 57 | Path Weight: 10.20 58 | 1 -> 2: 59 | (1,2,3.30) 60 | Path Weight: 3.30 61 | 1 -> 3: 62 | (1,0,2.00) -> (0,7,4.00) -> (7,3,3.40) 63 | Path Weight: 9.40 64 | 1 -> 4: 65 | (1,2,3.30) -> (2,4,1.10) 66 | Path Weight: 4.40 67 | 1 -> 5: 68 | (1,2,3.30) -> (2,5,2.70) 69 | Path Weight: 6.00 70 | 1 -> 6: 71 | (1,2,3.30) -> (2,4,1.10) -> (4,6,5.00) 72 | Path Weight: 9.40 73 | 1 -> 7: 74 | (1,0,2.00) -> (0,7,4.00) 75 | Path Weight: 6.00 76 | 1 -> 8: 77 | (1,8,8.20) 78 | Path Weight: 8.20 79 | 2 -> 3: 80 | (2,4,1.10) -> (4,7,3.00) -> (7,3,3.40) 81 | Path Weight: 7.50 82 | 2 -> 4: 83 | (2,4,1.10) 84 | Path Weight: 1.10 85 | 2 -> 5: 86 | (2,5,2.70) 87 | Path Weight: 2.70 88 | 2 -> 6: 89 | (2,4,1.10) -> (4,6,5.00) 90 | Path Weight: 6.10 91 | 2 -> 7: 92 | (2,4,1.10) -> (4,7,3.00) 93 | Path Weight: 4.10 94 | 2 -> 8: 95 | (2,5,2.70) -> (5,8,4.70) 96 | Path Weight: 7.40 97 | 3 -> 4: 98 | (3,7,3.40) -> (7,4,3.00) 99 | Path Weight: 6.40 100 | 3 -> 5: 101 | (3,7,3.40) -> (7,4,3.00) -> (4,2,1.10) -> (2,5,2.70) 102 | Path Weight: 10.20 103 | 3 -> 6: 104 | (3,7,3.40) -> (7,4,3.00) -> (4,6,5.00) 105 | Path Weight: 11.40 106 | 3 -> 7: 107 | (3,7,3.40) 108 | Path Weight: 3.40 109 | 3 -> 8: 110 | (3,7,3.40) -> (7,4,3.00) -> (4,2,1.10) -> (2,5,2.70) -> (5,8,4.70) 111 | Path Weight: 14.90 112 | 4 -> 5: 113 | (4,2,1.10) -> (2,5,2.70) 114 | Path Weight: 3.80 115 | 4 -> 6: 116 | (4,6,5.00) 117 | Path Weight: 5.00 118 | 4 -> 7: 119 | (4,7,3.00) 120 | Path Weight: 3.00 121 | 4 -> 8: 122 | (4,2,1.10) -> (2,5,2.70) -> (5,8,4.70) 123 | Path Weight: 8.50 124 | 5 -> 6: 125 | (5,6,5.80) 126 | Path Weight: 5.80 127 | 5 -> 7: 128 | (5,2,2.70) -> (2,4,1.10) -> (4,7,3.00) 129 | Path Weight: 6.80 130 | 5 -> 8: 131 | (5,8,4.70) 132 | Path Weight: 4.70 133 | 6 -> 7: 134 | (6,4,5.00) -> (4,7,3.00) 135 | Path Weight: 8.00 136 | 6 -> 8: 137 | (6,5,5.80) -> (5,8,4.70) 138 | Path Weight: 10.50 139 | 7 -> 8: 140 | (7,4,3.00) -> (4,2,1.10) -> (2,5,2.70) -> (5,8,4.70) 141 | Path Weight: 11.50 142 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/testCases/output071.txt: -------------------------------------------------------------------------------- 1 | Graph: 2 | (0, 1, 2.100) 3 | (0, 3, 2.100) 4 | (1, 2, 3.000) 5 | (1, 3, 2.400) 6 | (2, 3, 1.000) 7 | 8 | Depth First Traversal (vertex visited order): 9 | [0, 1, 2, 3] 10 | 11 | Breadth First Traversal (lowest-weight-next): 12 | [0, 1, 3, 2] 13 | 14 | Minimum Spanning Tree: 15 | (0, 1, 2.100) 16 | (0, 3, 2.100) 17 | (2, 3, 1.000) 18 | Type: Full Spanning Tree 19 | Total Weight: 5.200 20 | 21 | Shortest Paths: 22 | 0 -> 1: 23 | (0,1,2.10) 24 | Path Weight: 2.10 25 | 0 -> 2: 26 | (0,3,2.10) -> (3,2,1.00) 27 | Path Weight: 3.10 28 | 0 -> 3: 29 | (0,3,2.10) 30 | Path Weight: 2.10 31 | 1 -> 2: 32 | (1,2,3.00) 33 | Path Weight: 3.00 34 | 1 -> 3: 35 | (1,3,2.40) 36 | Path Weight: 2.40 37 | 2 -> 3: 38 | (2,3,1.00) 39 | Path Weight: 1.00 40 | -------------------------------------------------------------------------------- /notes/1207-Summer2020/graphDemo/weightedGraph.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 1 5.0 3 | 0 2 3.0 4 | 0 3 4.0 5 | 0 4 2.0 -------------------------------------------------------------------------------- /notes/1207-Summer2020/scratch.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1207-Summer2020/scratch.md -------------------------------------------------------------------------------- /notes/1217-Summer2021/0-intro.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III 3 | ## CSCE 310 - Summer 2021 4 | ### Course Introduction 5 | 6 | # Administrivia 7 | 8 | * Introductions 9 | * Chris Bourke 10 | * Sarah (GTA) 11 | * Course Format 12 | * Lecture: daily M-F 11 - 12:30 CDT 13 | * Office hours: 1PM - 2PM via zoom 14 | * Sarah: 3PM - 4PM via zoom 15 | * Recordings are available immediately after 16 | * Piazza/Canvas 17 | * Webhandin and webgrader 18 | * Syllabus 19 | 20 | # Review 21 | 22 | * Prerequisites for this course: CS1, CS2, Discrete Math 23 | * Proficiency in programming 24 | * Basic searching & Sorting algorithms 25 | * Basic algorithm & algorithm analysis 26 | * Basic data structures: stacks, queues, lists, binary search trees, graphs 27 | * Basic proofs and logic 28 | * Basic combinatorics 29 | 30 | # Review & Motivating Example 31 | 32 | * Problem: 33 | * Given: a collection of points in the cartesian plane 34 | * Output: the minimal distance between any two points 35 | 36 | * Algorithm Analysis: 37 | 1. Identify the input 38 | 2. Identify the input size 39 | 3. You identify the *elementary operation* 40 | 4. Analyze how many times the the elementary operation executes with respect to the input size *n* 41 | 5. Provide a Big-O (or Big Theta) analysis of the algorithm 42 | 43 | ```text 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | ``` 52 | -------------------------------------------------------------------------------- /notes/1217-Summer2021/1-bruteForce.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III 3 | ## CSCE 310 - Summer 2021 4 | ### Brute Force Algorithms 5 | 6 | * In general not a great solution; not really efficient 7 | * You generate or examine every possible solution to find *a* solution or the *best* solution to a problem 8 | * Often creating a brute force solution helps you to understand the problem and look for *structure* to exploit 9 | * Often such approaches require generating combinatorial objects 10 | * Example: finding the closet pair (generating combinations of size 2 = generating subsets of size 2 of a set of size *n*) 11 | 12 | ## Generating combinations 13 | 14 | * Given a set of $n$ elements: {1, 2, 3, 4, ..., n} 15 | * Outline: 16 | * Start with {1, 2, 3, ..., k} 17 | * Assume that you have elements a_1, a_2, ... a_k 18 | * Want to generate the next *k* combinations 19 | * Locate the last element a_i 20 | such that a_i != n - k + i 21 | * Replace a_i with a_i + 1 22 | * replace each a_j with a_i + j - i for all j: i+1 ... k 23 | 24 | ## 0-1 Knapsack Problem 25 | 26 | * Given: 27 | * A collection of items $A = \{a_1, \ldots, a_n\}$ 28 | * Each item has a *weight* $w_i$ 29 | * Each item has a *value* $v_i$ 30 | * Our knapsack has a maximum capacity of $K$ 31 | * We want to take items such that the total (sum) value of all the items is maximized, BUT subject to our weight constraint 32 | * Greedy approach will NOT work (may not give the optimal solution) 33 | * Generating all possible subsets and taking the best solution among all feasible solutions is possible 34 | 35 | ## Backtracking 36 | 37 | * Generating combinatorial objects is "blind" problem solving 38 | * We often need to take *structure* of the problem into account 39 | * We like structure: it can be exploited for more efficient solutions 40 | * You may not need to consider a large proportion of possible solutions 41 | * General technique of backtracking: 42 | * You iteratively (recursively) build a partial solution until it becomes infeasible in which case you *backtrack* to a previous partial solution 43 | * Walking a maze: once you hit a dead end, you backtrack 44 | * Chess: computer or 'AI' players will "look ahead" to a huge portion of possible moves and choose the best path 45 | 46 | ### Hamiltonian Path/Cycle 47 | 48 | * A Hamiltonian path (or cycle) is a simple path (cycle) in a graph that visits every vertex exactly once 49 | * Recall that undirected graphs are represented by a set of vertices $V = \{v_1, v_2, \ldots, v_n\}$ and a set of edges $E$ (undirected pairs of vertices), 50 | * $(u, v) \in E$ means that $u$ and $v$ are connected by an unoriented edge 51 | * Definition: given a vertex $v$, the *neighborhood* of $v$, denoted $N(v)$ is the set of vertices connected to it by a single edge 52 | * Variations: 53 | * Decision version: yes or no question: does a solution exist at all 54 | * Functional version: given a problem, if a solution exists, output it 55 | * Optimization problems: among all feasible solutions, output the best one 56 | * Counting Problem: *how many* solutions exist? 57 | Naive solution: generate Permutations 58 | 59 | ## Generating permutations 60 | 61 | * You start with the identity permutation: $1234...n$ 62 | * Given the current permutation, $a_1, a_2, \ldots, a_n$, we want to find the *next* permutation 63 | * Find the right-most (last) pair of elements, $a_i, a_{i+1}$ such that $a_i < a_{i+1}$ 64 | * Find the smallest element to the right ("tail") larger than $a_i$, call it $a'$ 65 | * swap $a'$ and $a_i$ 66 | * sort (order) the elements to the right of $a'$ 67 | 68 | ## More Combinatorial Objects 69 | 70 | * You can also generate general $k$-permutations 71 | * Generating permutations with repetition (binary strings, DNA sequences, etc.) 72 | 73 | ## More Problems 74 | 75 | ### Clique 76 | 77 | * Given a graph $G = (V,E)$ a *clique* is a subset of vertices $C \subseteq V$ such that every vertex in $C$ is connected 78 | * $C$ is a *complete subgraph* 79 | * Motivation: social networks, biology, dependency analysis, finding "dense" sub networks, a lot of redundancy 80 | * Clique problem: given a graph and an integer $k$, does the graph contain a clique of size $k$? 81 | * Optimization: given a graph, find the size of the largest clique 82 | * Naive approach: generate all possible subsets, verify that a subset is a clique, take the largest clique 83 | * Slightly better approach: take the graph connectivity into account: if you build a subset that is not a clique, then do not consider any further superset (backtrack if that is the case) 84 | 85 | ### Satisfiability 86 | 87 | * Recall that a predicate is a logical statement on $n$ boolean variables 88 | $$P(\vec{x}) = P(x_1, x_2, \ldots, x_n)$$ 89 | * Examples... 90 | * SAT: given a predicate on $n$ variables, does there exist an assignment of those variables (true or false) such that the predicate evaluates to true 91 | * This problem is equivalent to determining if the quantified statement, 92 | $$\exists x_1, x_2, \ldots x_n P(\vec{x})$$ 93 | * Naive approach: generate the truth table and evaluate it on all possible truth assignments 94 | * You generate all possible bit strings of length $n$ 95 | * Generate all permutations with repetition (count) 96 | * Better approach: generate *partial* assignments, if the assignment of a value to a variable makes the entire predicate false, backtrack 97 | 98 | ```c 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | ``` 109 | -------------------------------------------------------------------------------- /notes/1217-Summer2021/2-divideConquer.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III 3 | ## CSCE 310 - Summer 2021 4 | ### Divide & Conquer Algorithms 5 | 6 | ### Introduction 7 | 8 | * Divide a problem into smaller problems 9 | * Until the problem is easily or trivially solved (base case) 10 | * You may then need to combine sub-solutions to produce a solution the larger problem 11 | * Usually such approaches are presented as recursive, but they don't have to be 12 | * Well-suited for parallelization and distribute computing 13 | * MapReduce 14 | * Searching & Sorting 15 | * Tournament style strategies 16 | 17 | ## Repeated squaring 18 | 19 | * Task: compute 20 | \[ a^n \mod m \] 21 | for "large" $n$ 22 | * A naive approach of making $n-1$ multiplications leads to an exponential inefficiency 23 | * Repeated squaring: compute $a, a^2, a^4, a^8, \ldots$ using only 1 multiplication each 24 | * Include the result depending on the bit representation of $a$ 25 | * Leads to a $O(\log{n}) = O(N)$ where $N$ is the actual *true* input size 26 | * IE this algorithm is linear with respect to $n$ 27 | 28 | ### Karatsuba Multiplication 29 | 30 | * Can use the FOIL rule to reduce number of multiplications using a recursive divide & conquer approach 31 | 32 | ### Strassen's Matrix Multiplication 33 | 34 | * Normal definition implementation of matrix multiplication of two $n \times n$ matrices requires: 35 | * $n^3$ multiplications 36 | * $n^2(n-1)$ additions 37 | * Both are cubic 38 | * Strassen's identities led to 1 fewer multiplication (for $2 \times 2$ matrices) but 18 additions 39 | * Strassen's identities generalize to any $n \times n$ matrix 40 | * Problem: to divide evenly each time all through the recursion, requires matrices that are of size some power of 2: $n = 2^k$ 41 | * You can always pad out a matrix with zeros (left, right, bottom, top) without changing its values 42 | * When you are done, you can "trim" 43 | * How much better is this? 44 | * The number of multiplications made by Strassen is $O(n^{2.8074})$ 45 | * Likewise, the same analysis can show you that the number of additions is *also* $O(n^{2.8074})$ 46 | * Other improvements: 47 | * Winogard: $O(n^{2.3756})$ 48 | * Williams: $O(n^{2.3727})$ 49 | 50 | ### Closest Pair Revisited 51 | 52 | * Review 53 | * Naive Divide & Conquer approach 54 | * Outline of the good recursive/divide and conquer closest-pair algoirthm: 55 | 56 | Input: a set of points $S$, presorted with respect to the x coordinate 57 | 58 | 0. Base case: if the size of $S$ is "small enough": use brute force (generate all pairs) to solve the problem, return the pair/distance of the minimum distance pair 59 | 1. Partition $S$ into two roughly equally sized arrays/lists, $L$ and $R$ 60 | 2. Recursively find the two closest points (p, q) in $L$ and (r, s) in $R$ 61 | 3. Choose the closest pair between (p, q) and (r, s), call it (p, q) with distance $\delta$ 62 | 4. Find the median x-value ($m$) between the two partitions 63 | 5. Build a subset of $S$ whose x values are in $[m - \delta, m + \delta]$ 64 | * You need to use binary search to find these slice cutoffs: using a linear search gives you $O(n)$ behavior and overall a quadratic algorithm 65 | * Tip: make sure you include ALL points that may have equal $x$ values 66 | * Tip: you may want to maintain a *separate* left and right slice 67 | 6. For each p in the left slice: compute the distance to each potential point in the right slice; if you find a closer pair, update the closest pair/distance 68 | * Careful: there may be O(n) points in the right slice. 69 | * Solution A: sort the right slice with respect to their $y$ coordinates, use binary search to limit the number of comparisons to the $y$-range $[p.y-\delta, p.y + \delta]$ 70 | Solution B: so avoid resorting by sorting once and maintaining 2 lists, by-X and by-Y; when you split the lists, you split the Y list too 71 | 72 | 73 | ```text 74 | 75 | 76 | 77 | 78 | ``` 79 | -------------------------------------------------------------------------------- /notes/1217-Summer2021/5-dynamicProgramming.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III 3 | ## CSCE 310 - Summer 2021 4 | ### Dynamic Programming 5 | 6 | ## Introduction 7 | 8 | * "Dynamic" = fancy marketing term 9 | * Basic Idea 10 | * Divide & Conquer approach to problem solving 11 | * Eliminate redundant recursion with memoization (caching) 12 | * Eliminate the remaining recursion by using a tableau 13 | 14 | ## Motivating Example: computing binomials 15 | 16 | * Consider: 17 | $${n \choose k} = \frac{n!}{(n-k)!k!}$$ 18 | * Pascal's Identity: 19 | $${n \choose k} = {n-1 \choose k-1} + {n-1 \choose k}$$ 20 | * Base case: 21 | $${n \choose n} = 1 = {n \choose 0}$$ 22 | 23 | ## Basic Steps 24 | 25 | * Identify a value that represents the desired solution/optimal solution to a problem 26 | * Identify a recurrence identity in terms of values of "smaller" problems 27 | * Prove your recurrence is correct ("Optimal Substructure Property") 28 | * Identify trivial base cases 29 | * Identify the desired final result 30 | * Design a table/tableau: that holds values to each "sub"solution 31 | * Possibly: you may need to keep track of additional data in order to build the actual solution 32 | * You design loops to fill in the cells of the table so that "sub" problems that needed are computed first 33 | * fill out the cells in the table in the order that you need them 34 | 35 | ## Problem: Dynamic 0-1 Knapsack Problem 36 | 37 | * Given a collection of items with weights and values and a maximum capacity $W$, we want to take as many items as possible to maximize our value subject to the weight constraint 38 | * Building a solution 39 | * Complexity 40 | * Filling out the table is simply $O(nW)$ where $n$ is the number of items and $W$ is the weight capacity 41 | * Building a solution can be done in $O(n)$ 42 | * If we assume that $W$ is a constant, is the complexity linear? 43 | * Pseudolinear: the analysis is "hiding" the true complexity by ignoring $W$ 44 | * It could be that $W = O(2^n)$ 45 | * Suppose you have $n$ bits to represent $W$, then $W$ could be as large as $2^n$ 46 | * Consequently: your tableau would be exponentially sized 47 | 48 | ## Problem: Optimal Binary Search Trees 49 | 50 | * Given a set of keys and a probability distribution of searching those keys, create the "optimal" binary search tree 51 | 52 | ```text 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | ``` 68 | -------------------------------------------------------------------------------- /notes/1218-Fall2021/0-intro.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III Honors 3 | ## CSCE 310H - Fall 2021 4 | ### Course Introduction 5 | 6 | # Administrivia 7 | 8 | * Introductions 9 | * Course Format 10 | * Syllabus 11 | 12 | # Review 13 | 14 | * Prerequisites for this course: CS1, CS2, Discrete Math 15 | * Proficiency in programming 16 | * Basic searching & Sorting algorithms 17 | * Basic algorithm & algorithm analysis 18 | * Basic data structures: stacks, queues, lists, binary search trees, graphs 19 | * Basic proofs and logic 20 | * Basic combinatorics 21 | 22 | # Review & Motivating Example 23 | 24 | * given a set of points $\{(x_1, y_1), \ldots, (x_n, y_n)\}$ in 25 | the Euclidean plane, determine which pair is the closest 26 | 27 | 28 | ```text 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | ``` 37 | -------------------------------------------------------------------------------- /notes/1218-Fall2021/1-BruteForce.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III 3 | ## CSCE 310 - Fall 2021 4 | ### Brute Force Algorithms 5 | 6 | # Motivating Example 7 | 8 | * Given a set of points $\{(x_1, y_1), \ldots, (x_n, y_n)\}$ in 9 | the Euclidean plane, determine which pair is the closest 10 | 11 | # Introduction 12 | 13 | * Brute Force style algorithms simply try every single possibility: 14 | * You find the *best* solution (optimization problems) 15 | * You need to examine every possible solution to determine if they are valid/feasible (decision problems) 16 | * You need to create a solution (functional problems) 17 | * In general brute forcing is not ideal, not efficient, not feasible 18 | * Often creating a brute force algorithm means generating combinatorial objects 19 | * Example: we generated pairs or combinations of 2 from a set of $n$ elements 20 | 21 | ## Generating Combinations 22 | 23 | * Given a set of $n$ elements, $\{1, 2, 3, \ldots, n\}$ 24 | * Outline: 25 | * Start with $\{1, 2, 3, \ldots, k\}$ 26 | * Assume that you have a "current" combination, $a_1, a_2, \ldots, a_k$ 27 | * Want to generate the *next* $k$ combination 28 | * Locate the last element $a_i$ such that $a_i \neq n - k + i$ 29 | * Replace $a_i$ with $a_i + 1$ 30 | * Replace each $a_j$ with $a_i + j - i$ for all $j = i+1, i+2, ... k$ 31 | 32 | ## Generating Permutations 33 | 34 | * Given a set of $n$ elements, $\{1, 2, 3, \ldots, n\}$ we want to 35 | generate all possible *permutations* 36 | * Permutation review 37 | * An ordered arrangment of elements 38 | * In general there are $n!$ possible permutations of $n$ elements 39 | * Given a current permutation, $a_1, a_2, \ldots, a_n$ we want to find the *next* permutation: 40 | * Find the right-most (last) pair of elements $a_i, a_{i+1}$ such that $a_i < a_{i+1}$ 41 | * Find the smallest element to the right of $a_i$ (the "tail" of the permutation) larger than $a_i$ call it $a'$ 42 | * Swap $a'$ and $a_i$ 43 | * Sort (order) the elemnts to the right of $a'$ 44 | 45 | ## Problems 46 | 47 | ### Hamiltonian Path Problem 48 | 49 | * Given an undirected graph $G = (V, E)$ (with vertices $V = \{v_1, v_2, \ldots, v_n\}$ and edges $E$) determine if there is a *Hamiltonian Path* or not 50 | * A Hamiltonian Path is a path in a graph that traverses every vertex exactly once 51 | * Brute Force (combinatorial) solution: 52 | * generate every permutation of every vertex and check if it is a Hamiltonian Path 53 | 54 | ## Backtracking 55 | 56 | * Generating combinatorial objects is "blind" problem solving 57 | * Often we need or it is better to take the *structure* of the problem or the input into account 58 | * We like structure: structure can be exploited 59 | * Generally brute force "backtracking" is not necessarily better asymptotically 60 | * But in practice it can save a lot of work and make "exponential" algorithms more feasible 61 | * General technique: 62 | * You iteratively (recursively) build a partial solution until you reach a feasible solution or you reach a "dead end" at which point you backtrack 63 | * Walking a maze: you keep track of where you've been (breadcrumbs) 64 | * Chess: computer "AI" player will simply "look ahead" and choose the best possible move 65 | 66 | ### 0-1 Knapsack Problem 67 | 68 | * Given: 69 | * A collection of items $A = \{a_1, \ldots, a_n\}$ 70 | * Each item has a *weight* $w_i$ 71 | * Each item has a *value* $v_i$ 72 | * Our knapsack has a maximum capacity of $K$ 73 | * Want to steal as much as possible subject to our weight capacity 74 | * Want to maximize the sum of the values of all items we take 75 | * BUT, the sum of all weights of items we take cannot exceed $K$ 76 | * Greedy approach is not necessarily optimal 77 | * Attempting to max out your weight capacity is not necessarily optimal 78 | * Combinatorial approach: generate every possible combination (subset) 79 | * If the sum of weights exceeds $K$ it is not a *feasible* solution 80 | * Among all feasible solutions, you choose the best one (maximum sum of values) 81 | * Backtracking solution: 82 | * Iteratively/recursively create all possible subsets 83 | * 84 | 85 | ```python 86 | 87 | import copy 88 | 89 | count = 0 90 | 91 | def subsetTree(set, subset, k): 92 | """ 93 | set is the original set 94 | subset is the current subset consisting of some of 95 | the elements a_1 thru a_k 96 | k is the index of the elements 97 | 98 | going to make recursive calls to generate all other 99 | subsets 100 | """ 101 | global count 102 | n = len(set) 103 | if k == n: 104 | return 105 | for j in range(k+1, n): 106 | #add set[j] to the subset and 107 | newSubset = copy.deepcopy(subset) 108 | newSubset.append(set[j]) 109 | # "process" the current subset... 110 | print(newSubset) 111 | count += 1 112 | # recurse 113 | subsetTree(set, newSubset, j) 114 | #alternative: subset.pop() 115 | 116 | n = 4 117 | set = list(range(n)) 118 | subset = [] 119 | subsetTree(set, subset, -1) 120 | print(count) 121 | ``` 122 | 123 | ## Other Problems and Brute Force Solutions 124 | 125 | * Permutations with repetition 126 | * Example: $\{A, G, C, T\}$ 127 | * Generate permutations of these with repetition of length 10 128 | * In general, there are $4^k$ possible permutations with repetition of length $k$ of 4 elements 129 | * More generally: 130 | $$n^k$$ 131 | possible permutations with repetition of $n$ elements of length $k$ 132 | * Set partitions? 133 | * Given a set $\{a, b, c\}$ how many partitions are there? 134 | * Partitioning is a set of all elements divided into subsets 135 | 136 | 137 | ```text 138 | 139 | 140 | 141 | 142 | ``` 143 | -------------------------------------------------------------------------------- /notes/1218-Fall2021/5-DynamicProgramming.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III 3 | ## CSCE 310H - Fall 2021 4 | ### Dynamic Programming 5 | 6 | ## Introduction 7 | 8 | * "Dynamic" = fancy marketing term 9 | * Basic Idea 10 | * Divide & Conquer approach to problem solving 11 | * Eliminate redundant recursion with memoization (caching) 12 | * Eliminate the remaining recursion by using a tableau 13 | 14 | ### Illustrative Example: computing binomials 15 | 16 | * Consider: 17 | $${n \choose k} = \frac{n!}{(n-k)!k!}$$ 18 | * Pascal's Identity: 19 | $${n \choose k} = {n-1 \choose k-1} + {n-1 \choose k}$$ 20 | * Base case: 21 | $${n \choose n} = 1 = {n \choose 0}$$ 22 | 23 | ## FAST Method 24 | 25 | https://www.byte-by-byte.com/fast-method/ 26 | 27 | * First Solution 28 | * Analyze the first solution 29 | * Identify the *S*ubproblems 30 | * Turn the solution around 31 | 32 | ## Basic Steps 33 | 34 | * Identify a value that represents the desired solution/optimal solution to a problem 35 | * Identify a recurrence identity in terms of "smaller" values of the problem 36 | * Use math to prove your recurrence is correct ("Optimal Substructure Property") 37 | * Identify the (trivial) base case 38 | * Identify the desired *final* result 39 | * Design a table or "tableau" that holds values to each "sub"solution 40 | * Possibly: you may need to keep track of additional data in order to reformulate the solution 41 | * You then design your loops to fill in the table so that the necessary subproblems are available in a proper order 42 | * Then you fill out the table in the order you need to 43 | 44 | ## Problem: Dynamic 0-1 Knapsack Problem 45 | 46 | * Analysis: 47 | * The size of the table is $n \times W$ 48 | * Thus filling out the table is $O(nW)$ 49 | * Can you treat $W$ as a constant? If so, it **looks** to be linear: $O(n)$ 50 | * It could be that $W = O(2^n)$ 51 | * Generally the input size is bounded by some value, suppose $n$ 52 | * What is the maximum value you can represent if you have $n$ bits? $2^n - 1$ 53 | * This algorithm is "pseudolinear": the analysis is *hiding* the true complexity if you ignore $W$ 54 | * The 0-1 knapsack problem is $\mathsf{NP}$-complete: no polynomial time algorithm is known for it (or even though to exist) 55 | 56 | ## Optimal Binary Search Trees (OBSTs) 57 | 58 | * Given a set of keys and a probability distribution of searching those keys, create the "optimal" binary search tree 59 | * Keys are still *ordered* and the BST property must be maintained 60 | * Don't want to necessarily *balance* the tree: want to optimize for searches 61 | * Optimization: minimize the number of *expected* key comparisons 62 | 63 | Basic Idea 64 | 65 | * Keys: $k_1, \ldots, k_n$ with probabilities $p_1, \ldots, p_n$ 66 | * Let $C_{i,j}$ be the optimal BST for keys $k_i, \ldots, k_j$... 67 | 68 | 69 | ```text 70 | 71 | 72 | 73 | 74 | 75 | ``` 76 | -------------------------------------------------------------------------------- /notes/1218-Fall2021/Module3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1218-Fall2021/Module3.pdf -------------------------------------------------------------------------------- /notes/1218-Fall2021/Module4-Graphs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1218-Fall2021/Module4-Graphs.pdf -------------------------------------------------------------------------------- /notes/1218-Fall2021/Module5-DynamicProgramming.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1218-Fall2021/Module5-DynamicProgramming.pdf -------------------------------------------------------------------------------- /notes/1218-Fall2021/Module6-Computation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1218-Fall2021/Module6-Computation.pdf -------------------------------------------------------------------------------- /notes/1218-Fall2021/Modules1-2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbourke/ComputerScienceIII/be0fe3056364fd0b07fb835bfced0f338690e5f1/notes/1218-Fall2021/Modules1-2.pdf -------------------------------------------------------------------------------- /notes/1228-Fall2022/0-intro.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III Honors 3 | ## CSCE 310H - Fall 2022 4 | ### Course Introduction 5 | 6 | # Administrivia 7 | 8 | * Introductions 9 | * Course Format 10 | * Syllabus 11 | 12 | # Review 13 | 14 | * Prerequisites for this course: CS1, CS2, Discrete Math 15 | * Proficiency in programming 16 | * Basic searching & Sorting algorithms 17 | * Basic algorithm & algorithm analysis 18 | * Basic data structures: stacks, queues, lists, binary search trees, graphs 19 | * Basic proofs and logic 20 | * Basic combinatorics 21 | 22 | # Review & Motivating Example 23 | 24 | * given a set of points $\{(x_1, y_1), \ldots, (x_n, y_n)\}$ in 25 | the Euclidean plane, determine which pair is the closest 26 | -------------------------------------------------------------------------------- /notes/1228-Fall2022/1-bruteForceAlgos.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III 3 | ## CSCE 310H - Fall 2022 4 | ### Brute Force Algorithms 5 | 6 | # Motivating Example 7 | 8 | * Given a set of points $\{(x_1, y_1), \ldots, (x_n, y_n)\}$ in 9 | the Euclidean plane, determine which pair is the closest 10 | 11 | # Introduction 12 | 13 | * Brute Force style algorithms simply try every single possibility: 14 | * Sometimes it is about optimization: you try every solution and then choose the *best* (optimization problems) 15 | * You may need to examine every possible solution to determine that there is *no* valid or feasible solution (decision problems) 16 | * You may need to actually find a solution (functional problem) 17 | * In general, brute forcing is not ideal, efficient or even feasible 18 | * BUT: a brute force solution *might* be a good approach for *small* input sizes 19 | * Generally: it may involve generating *combinatorial objects* (pairs, triples, permutations) 20 | 21 | ## Generating Combinatorial Objects: Combinations 22 | 23 | ### Generating *All* Combinations 24 | 25 | * Simply count in binary 26 | * Each bit is associated with an element, 0 if a subset does not contain 27 | the element, 1 if it does 28 | 29 | ### Generating $k$-Combinations 30 | 31 | * Given a set of $n$ elements, $\{0, 1, 2, 3, \ldots, n-1\}$ want to generate all possible $k$-combinations 32 | * Outline: 33 | * Start with the combination $\{0, 1, 2, \ldots, k-1\}$ 34 | * given the current combination of $a_0, a_1, a_2, \ldots, a_{k-1}$ want to generate the next one 35 | * Locate the last element $a_i$ such that $a_i \neq n - k + i$ 36 | * Replace $a_i$ with $a_i + 1$ 37 | * Replace each $a_j$ with $a_i + j - i$ for all $j = i+1, i+2, ... k$ 38 | 39 | ## Generating Permutations 40 | 41 | * Review 42 | * Given a set of $n$ elements, $\{1, 2, 3, \ldots, n\}$ we want to 43 | generate all possible *permutations* 44 | * Permutation review 45 | * An ordered arrangment of elements 46 | * In general there are $n!$ possible permutations of $n$ elements 47 | * Given a current permutation, $a_1, a_2, \ldots, a_n$ we want to find the *next* permutation: 48 | * Find the right-most (last) pair of elements $a_i, a_{i+1}$ such that $a_i < a_{i+1}$ 49 | * Find the smallest element to the right of $a_i$ (the "tail" of the permutation) larger than $a_i$ call it $a'$ 50 | * Swap $a'$ and $a_i$ 51 | * Sort (order) the elemnts to the right of $a'$ 52 | 53 | ## Computational Problems 54 | 55 | ### 0-1 Knapsack Problem 56 | 57 | * Given: 58 | * A collection of items $A = \{a_1, \ldots, a_n\}$ 59 | * Each item has a weight $w_i$ 60 | * Each item has a value $v_i$ 61 | * Our knapsack has a maximum capacity of $K$ 62 | * We want to maximize our total value (sum of the values of the things we take) 63 | * Subject to the maximum weight capacity (sum of weights of things we take cannot exceed $K$) 64 | * Greedy approach is not necessarily optimal 65 | * Attempting to max out your weight capacity is not necessarily optimal 66 | * Combinatorial approach: generate every possible combination (subset) 67 | * If the sum of weights exceeds $K$ it is not a *feasible* solution 68 | * Among all feasible solutions, you choose the best one (maximum sum of values) 69 | * Backtracking solution: 70 | * Iteratively/recursively create all possible subsets 71 | 72 | ### Hamiltonian Path Problem 73 | 74 | * Given an undirected graph $G = (V, E)$ (with vertices $V = \{v_1, v_2, \ldots, v_n\}$ and edges $E$) determine if there is a *Hamiltonian Path* or not 75 | * A Hamiltonian Path is a path in a graph that traverses every vertex exactly once 76 | * Brute Force (combinatorial) solution: 77 | * generate every permutation of every vertex and check if it is a Hamiltonian Path 78 | 79 | 80 | ```text 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | ``` 90 | -------------------------------------------------------------------------------- /notes/1228-Fall2022/5-DynamicProgramming.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III 3 | ## CSCE 310H - Fall 2022 4 | ### Dynamic Programming 5 | 6 | ## Introduction 7 | 8 | * "Dynamic" = fancy marketing term 9 | * Basic Idea 10 | * Divide & Conquer approach to problem solving 11 | * Eliminate redundant recursion with memoization (caching) 12 | * Eliminate the remaining recursion by using a tableau 13 | 14 | ## Motivating Example: Computing Binomials 15 | 16 | * Consider: 17 | $${n \choose k} = \frac{n!}{(n-k)!k!}$$ 18 | * Pascal's Identity: 19 | $${n \choose k} = {n-1 \choose k-1} + {n-1 \choose k}$$ 20 | * Base cases: 21 | $${n \choose n} = 1 = {n \choose 0}$$ 22 | 23 | ## FAST Method 24 | 25 | https://www.byte-by-byte.com/fast-method/ 26 | 27 | * First Solution 28 | * Analyze the first solution 29 | * Identify the *S*ubproblems 30 | * Turn the solution around 31 | 32 | 33 | ```python 34 | 35 | 36 | n = 100 37 | k = 50 38 | 39 | def binomial(n, k): 40 | """returns the value n choose k""" 41 | if n == k or k == 0: 42 | return 1 43 | else: 44 | return binomial(n-1,k-1) + binomial(n-1, k) 45 | 46 | def binomialMemoization(map, n, k): 47 | """ computes the value n choose k using memoization 48 | the given map is assumed to be dictionary mapping 49 | (n, k) => n choose k 50 | """ 51 | if (n, k) in map: 52 | return map.get( (n, k) ) 53 | elif n == k or k == 0: 54 | return 1 55 | else: 56 | a = binomialMemoization(map, n-1, k-1) 57 | b = binomialMemoization(map, n-1, k) 58 | r = a + b 59 | map[ (n,k) ] = r 60 | return r 61 | 62 | def binomialDynamicProgramming(n, k): 63 | """produces the value of n choose k using dynamic programming: 64 | filling out a tableau of pascal's triangle 65 | """ 66 | c = {} # (i, j) => i choose j values 67 | for i in range(0, n+1): 68 | for j in range(0, min(i, k) + 1): 69 | #if a base case: 70 | if i == j or j == 0: 71 | c[ (i,j) ] = 1 72 | else: 73 | c[ (i,j) ] = c[ (i-1,j-1) ] + c[ (i-1,j) ] 74 | return c[ (n,k) ] 75 | 76 | 77 | r = binomialDynamicProgramming(n, k) 78 | print(f"{n} choose {k} = {r}") 79 | ``` 80 | 81 | ## Basic Steps 82 | 83 | * Identify a value that represents the desired solution/optimal solution to a problem 84 | * Identify a recurrence identity in terms of "smaller" values of the problem (subsolutions) 85 | * You use math to prove your recurrence is correct ("Optimal Substructure Property") 86 | * Identify the trivial base cases 87 | * Identify the final desired result 88 | * Design a table or "tableau" that holds values for each subproblem 89 | * POssibly: you may need to keep track of additional information in order to build the actual solution; the table may only hold the optimal *values* 90 | * You then design your loops to fill out the tableau in an order such that the needed subproblem solutions are available 91 | * Then you fill out the table in the order you need to 92 | 93 | ## Examples 94 | 95 | * Optimal Binary Search Trees 96 | * 0-1 Knapsack Problem 97 | 98 | ## Optimal Binary Search Trees (OBSTs) 99 | 100 | * Given a set of keys and a probability distribution of searching those keys, create the "optimal" binary search tree 101 | * Keys are still *ordered* and the BST property must be maintained 102 | * Don't want to necessarily *balance* the tree: want to optimize for searches 103 | * Optimization: minimize the number of *expected* key comparisons 104 | 105 | Basic Idea 106 | 107 | * Keys: $k_1, \ldots, k_n$ with probabilities $p_1, \ldots, p_n$ 108 | * Let $C_{i,j}$ be the optimal BST for keys $k_i, \ldots, k_j$... 109 | 110 | ## 0-1 Knapsack Problem 111 | 112 | ### Illustrative Example 113 | 114 | Consider the following input: 115 | * Items: $a_1, a_2, \ldots, a_{13}$ 116 | * Weights: $\vec{w} = 5, 3, 8, 9, 7, 1, 4, 9, 8, 1, 3, 2, 3$ 117 | * Values: $\vec{v} = 22, 55, 36, 48, 10, 35, 25, 15, 8, 44, 47, 13, 30$ 118 | * Capacity: $W=15$ 119 | Consider: 120 | * $V_{i,j} = V_{6,8}$ 121 | * Interpretation: What is the optimal solution value involving 122 | * Items $a_1, a_2, a_3, a_4, a_5, a_6$ 123 | * With (intermediate) capacity 8? 124 | * Consider the **previous** optimal solution involving 125 | * Items $a_1, a_2, a_3, a_4, a_5$ 126 | * Same weight capacity of 8 127 | * Best possible solution has value $V_{5, 8}$ 128 | * Best value: 77 129 | * Items $a_1, a_2$ 130 | * Weight is 8 (we're at the intermediate capacity) 131 | * Consider taking $a_6$ instead: 132 | * If we don't take it, then we have the same solution: 133 | $a_1, a_2$, ie: $V_{5,8}$ or $V_{i-1,j}$ in general 134 | * If we do: then we need to get rid of something else 135 | * Adding $a_6$: 136 | * We have an added value of +35 137 | * We have reduced our capacity by the weight of $a_6$: which is 1 138 | * New weight capacity is 7: 139 | * Reduces our capacity to $j - w_6 = 8 - 1 = 7$ 140 | * Then the best subsolution is $V_{i-1, j-w_i} = V_{5, 7} = 55$ 141 | * New solution: $a_2, a_6$ (weight: $3 + 1 = 4$, value: $55 + 35 = 90$ 142 | * 90 is better than 77, so *we choose to include $a_6$* 143 | * Column 8: changes from $77$ to $90$ indicating we took item $a_i = a_6$ 144 | 145 | 146 | 147 | ```text 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | ``` 161 | -------------------------------------------------------------------------------- /notes/1228-Fall2022/code/closestPairBruteForce.py: -------------------------------------------------------------------------------- 1 | 2 | import math 3 | import random 4 | 5 | def getRandomPoints(n): 6 | points = [] 7 | for i in range(n): 8 | points.append( (random.randint(-1000000000, 1000000000), 9 | random.randint(-1000000000, 1000000000) ) ) 10 | return points 11 | 12 | n = 1000000 13 | pts = getRandomPoints(n) 14 | minDist = math.inf 15 | numComps = 0 16 | 17 | for i in range(n-1): 18 | for j in range(i+1, n): 19 | (x1,y1) = pts[i] 20 | (x2,y2) = pts[j] 21 | dist = math.sqrt( (x1-x2) * (x1-x2) + (y1-y2)*(y1-y2)) 22 | #print(f"comparing ({x1},{y1}) and ({x2}, {y2}): distance = {dist}") 23 | numComps += 1 24 | if dist < minDist: 25 | minDist = dist 26 | closestPair = ( (x1,y1), (x2,y2) ) 27 | 28 | print("Found closest pair: ") 29 | print(closestPair) 30 | print("num comps = " + str(numComps)) 31 | -------------------------------------------------------------------------------- /notes/1228-Fall2022/code/k-combo.py: -------------------------------------------------------------------------------- 1 | 2 | import copy 3 | 4 | def exploreAllCombos(set, currentSubset, i): 5 | """ 6 | Given a set and a (current) subset of it and an index i 7 | this function explores the next subsets recursively by 8 | considering elements set[i+1] thru set[n-1] 9 | """ 10 | n = len(set) 11 | if i >= n: 12 | #done 13 | return 14 | # TODO: process the current subset whatever "process" means 15 | print(currentSubset) 16 | # consider elements i+1 ... n-1 in set: 17 | # add them to the subset and recurse 18 | for j in range(i+1, n): 19 | # add set[j] to currentSubset 20 | currentSubset.append(set[j]) 21 | # recurse 22 | exploreAllCombos(set, currentSubset, j) 23 | # remove the last element (that was added) to set yourself up 24 | # for the next loop... 25 | currentSubset.pop() 26 | 27 | 28 | def nextCombo(combo, n): 29 | """ 30 | Given a current k-combination of integers 0 thru n-1, 31 | this function produces a *new* list representing the 32 | next k-combination. 33 | 34 | Returns None when no more combinations are possible 35 | """ 36 | result = copy.deepcopy(combo) 37 | k = len(combo) 38 | # find the last element such that element != n - k + i 39 | i = k - 1 40 | while i >= 0 and result[i] == n - k + i: 41 | i -= 1 42 | if i < 0: 43 | # no next combination... 44 | return None 45 | # the element at i needs to be replaced with a[i] + 1 46 | result[i] += 1 47 | for j in range(i + 1, k): 48 | #replace result[j] with result[i] + j - i 49 | result[j] = result[i] + j - i 50 | return result 51 | 52 | 53 | n = 4 54 | k = 2 55 | combo = [0, 1, 2, 3] 56 | count = 0 57 | exploreAllCombos(combo, [], -1) 58 | 59 | 60 | # while combo is not None: 61 | # print(combo) 62 | # combo = nextCombo(combo, n) 63 | # count += 1 64 | # 65 | # msg = "found " + str(count) + " combos!" 66 | # print("found ", count, " combos!") 67 | # print(msg) 68 | -------------------------------------------------------------------------------- /notes/1228-Fall2022/code/permutations.py: -------------------------------------------------------------------------------- 1 | 2 | import copy 3 | 4 | def nextPerm(arr): 5 | """ 6 | Generates the next (ordered) permutation of the 7 | given elements (elements 0 thru n-1). 8 | 9 | """ 10 | # 1. Find the right most pair such that a[i] < a[i+1] 11 | a = copy.deepcopy(arr) 12 | n = len(a) 13 | i = n-2 14 | while i >= 0 and a[i] >= a[i+1]: 15 | i -= 1 16 | if i < 0: 17 | return None 18 | # 2. Find the smallest element a' to the right of a[i] such that a[i] < a' 19 | indexOfMin = i + 1 20 | for j in range(i+1, n): 21 | if a[j] > a[i] and a[j] < a[indexOfMin]: 22 | indexOfMin = j 23 | # 3. Swap a[i], a' (indexOfMin) 24 | a[i], a[indexOfMin] = a[indexOfMin], a[i] 25 | # 4. Sort everything to the right of a' 26 | a[i+1:] = sorted(a[i+1:]) 27 | return a 28 | 29 | 30 | arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 31 | count = 0 32 | while arr is not None: 33 | #print(arr) 34 | arr = nextPerm(arr) 35 | count += 1 36 | print("found ", count, " permutations") 37 | -------------------------------------------------------------------------------- /notes/1228-Fall2022/code/subsets.py: -------------------------------------------------------------------------------- 1 | 2 | letters = "abcdefghijklmnopqrstuvwxyz" 3 | list = [*letters] 4 | n = len(list) 5 | 6 | for i in range(2**n): 7 | bin = format(i, 'b') 8 | # pad out with leading zeros... 9 | while len(bin) < n: 10 | bin = "0" + bin 11 | print(f"{i}, {bin}") 12 | # build the subset... 13 | subset = [] 14 | for j in range(len(bin)): 15 | if bin[j] == "1": 16 | subset.append(list[j]) 17 | print(subset) 18 | -------------------------------------------------------------------------------- /notes/1238-Fall2023/0-intro.md: -------------------------------------------------------------------------------- 1 | 2 | # Computer Science III Honors 3 | ## CSCE 310H - Fall 2023 4 | ### Course Introduction 5 | 6 | # Administrivia 7 | 8 | * Introductions 9 | * Course Format 10 | * Syllabus 11 | 12 | # Review 13 | 14 | * Prerequisites for this course: CS1, CS2, Discrete Math 15 | * Proficiency in programming 16 | * Basic searching & Sorting algorithms 17 | * Basic algorithm & algorithm analysis 18 | * Basic data structures: stacks, queues, lists, binary search trees, graphs 19 | * Basic proofs and logic 20 | * Basic combinatorics 21 | 22 | # Review & Motivating Example 23 | 24 | * Given a set of points $\{(x_1, y_1), \ldots, (x_n, y_n)\}$ in 25 | the Euclidean plane, determine which pair is the closest 26 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Computer Science III 2 | ### CSCE 310 - Data Structures & Algorithms 3 | 4 | **[School of Computing](https://computing.unl.edu)** 5 | **[College of Engineering](https://engineering.unl.edu/)** 6 | **[University of Nebraska-Lincoln](https://unl.edu)** 7 | 8 | This repository hosts documents, files, and other artifacts 9 | related to Computer Science III (offered as CSCE 310) at 10 | the University of Nebraska-Lincoln 11 | 12 | ## Lecture Notes 13 | 14 | My lecture note set is available on BitBucket: 15 | https://bitbucket.org/chrisbourke/computerscienceiii/src/master/ComputerScienceThree.pdf 16 | 17 | ## Course Offerings 18 | 19 | ### Fall 2022 (Honors) 20 | 21 | - Course Link: https://canvas.unl.edu/courses/136571 22 | - Lectures: https://www.youtube.com/playlist?list=PL4IH6CVPpTZWXnPzeWZuLG_dGvF4jhPQG 23 | 24 | ### Fall 2021 (Honors) 25 | 26 | - Course Link: https://canvas.unl.edu/courses/114259 27 | - Lectures: https://www.youtube.com/playlist?list=PL4IH6CVPpTZXVukWxmJHMFAUb6qwr3lBD 28 | 29 | ### Summer 2021 30 | 31 | - Course Link: https://canvas.unl.edu/courses/108493 32 | - Lectures: https://www.youtube.com/playlist?list=PL4IH6CVPpTZXGuvXF4g1ZM4iP73KvnVdg 33 | 34 | ### Summer 2020 35 | 36 | - Course Link: https://canvas.unl.edu/courses/83536 37 | - Lectures: https://www.youtube.com/playlist?list=PL4IH6CVPpTZURyb_9UK3OqzypICKp1mPl 38 | 39 | ### Summer 2019 40 | 41 | - Course Link: https://canvas.unl.edu/courses/61131 42 | - Lectures: https://www.youtube.com/playlist?list=PL4IH6CVPpTZXFWlwcETsqhgJfyrnZvzOw 43 | 44 | ## Other Resources 45 | 46 | Some free online resources including related courses and 47 | textbooks: 48 | 49 | - [Coursera Algorithms](https://www.coursera.org/course/algo) 50 | - [Coursera Algorithms II](https://www.coursera.org/course/algo2) 51 | - [Algorithms](http://jeffe.cs.illinois.edu/teaching/algorithms/) textbook by Jeff Erickson 52 | - [Open DSA](http://opendatastructures.org/) textbook 53 | 54 | ### Algorithm & Data Structure Visualization Tools 55 | 56 | - https://algorithm-visualizer.org/ 57 | - https://visualgo.net/en 58 | - https://graphery.reedcompbio.org/ 59 | - https://www.cs.usfca.edu/~galles/visualization/Algorithms.html 60 | 61 | ### LaTeX 62 | 63 | Though you can submit written assignments hand written, you 64 | can never go wrong with LaTeX, here are some resources: 65 | 66 | - [Getting Started With Latex](http://www.tug.org/begin.html) 67 | - [LaTeX Templates](http://www.latextemplates.com/) 68 | 69 | ### Python 70 | 71 | Though in general you'll be able to use any programming language 72 | for this course, but we recommend [Python 3](https://www.python.org/). 73 | Some free courses to help you learn: 74 | 75 | - [Code Academy](https://www.codecademy.com/learn/learn-python-3) 76 | - [Coursera](https://www.coursera.org/learn/python) 77 | - Also: [Getting Started](https://www.youtube.com/watch?v=YnL9vAFphmE) 78 | --------------------------------------------------------------------------------