// File: Manca[P]algorithms1/./assignment5.hpp
// Function: assignment5::computeShortestPaths()
void computeShortestPaths()
    {
        if (_G.size() == 0)
            return;
        
        while (_processed_so_far.size() != _G.size())
        {
            // for each edge (u, v) where u in X and v not in X
            std::pair<int,int> min_pair;
            int local_min = -1;
            for (int vertex : _processed_so_far)
            {
                for (auto edge : _G[vertex])
                {
                    // target vertex (v) is not in X
                    if (std::find(_processed_so_far.begin(), _processed_so_far.end(), edge.first) == _processed_so_far.end())
                    {
                        if (local_min == -1 || _shortest_paths[vertex] + edge.second < local_min)
                        {
                            min_pair = edge;
                            local_min = _shortest_paths[vertex] + edge.second;
                        }
                    }
                }
            }
            _processed_so_far.push_back(min_pair.first);
            _shortest_paths[min_pair.first] = local_min;
        }
        
        // reporting shortest paths for: 7,37,59,82,99,115,133,165,188,197
        cout << "Dijkstra's algorithm computed shortest paths to nodes 7,37,59,82,99,115,133,165,188,197: " << endl;
        cout << _shortest_paths[7] << ", ";
        cout << _shortest_paths[37] << ", ";
        cout << _shortest_paths[59] << ", ";
        cout << _shortest_paths[82] << ", ";
        cout << _shortest_paths[99] << ", ";
        cout << _shortest_paths[115] << ", ";
        cout << _shortest_paths[133] << ", ";
        cout << _shortest_paths[165] << ", ";
        cout << _shortest_paths[188] << ", ";
        cout << _shortest_paths[197] << ", respectively." << endl;
    }

// Assembly:
subq $0x88, %rsp
leaq 0x1e162(%rip), %rdi     # 0x24240
callq 0x8db0
cmpq $0x0, %rax
jne 0x60ee
jmp 0x64f5
jmp 0x60f0
leaq 0x1e191(%rip), %rdi     # 0x24288
callq 0x7f90
movq %rax, 0x10(%rsp)
leaq 0x1e138(%rip), %rdi     # 0x24240
callq 0x8db0
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
je 0x62f8
leaq 0x80(%rsp), %rdi
callq 0x8df0
movl $0xffffffff, 0x7c(%rsp) # imm = 0xFFFFFFFF
leaq 0x1e14e(%rip), %rax     # 0x24288
movq %rax, 0x70(%rsp)
leaq 0x1e142(%rip), %rdi     # 0x24288
callq 0x8360
movq %rax, 0x68(%rsp)
leaq 0x1e131(%rip), %rdi     # 0x24288
callq 0x8480
movq %rax, 0x60(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x8620
testb $0x1, %al
jne 0x6179
jmp 0x62bd
leaq 0x68(%rsp), %rdi
callq 0x8660
movl (%rax), %eax
movl %eax, 0x5c(%rsp)
leaq 0x1e0b0(%rip), %rdi     # 0x24240
leaq 0x5c(%rsp), %rsi
callq 0x8c60
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
callq 0x8e10
movq %rax, 0x48(%rsp)
movq 0x50(%rsp), %rdi
callq 0x8e40
movq %rax, 0x40(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x8e70
testb $0x1, %al
jne 0x61d5
jmp 0x62ac
leaq 0x48(%rsp), %rdi
callq 0x8eb0
movq (%rax), %rax
movq %rax, 0x38(%rsp)
leaq 0x1e09a(%rip), %rdi     # 0x24288
callq 0x8360
movq %rax, 0x28(%rsp)
leaq 0x1e089(%rip), %rdi     # 0x24288
callq 0x8480
movq %rax, 0x20(%rsp)
leaq 0x38(%rsp), %rdx
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x8f00
movq %rax, 0x30(%rsp)
leaq 0x1e05f(%rip), %rdi     # 0x24288
callq 0x8480
movq %rax, 0x18(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x8ec0
testb $0x1, %al
jne 0x6248
jmp 0x629b
cmpl $-0x1, 0x7c(%rsp)
je 0x626c
movslq 0x5c(%rsp), %rsi
leaq 0x1e015(%rip), %rdi     # 0x24270
callq 0x84b0
movl (%rax), %eax
addl 0x3c(%rsp), %eax
cmpl 0x7c(%rsp), %eax
jge 0x6299
leaq 0x80(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x8f60
movslq 0x5c(%rsp), %rsi
leaq 0x1dfe6(%rip), %rdi     # 0x24270
callq 0x84b0
movl (%rax), %eax
addl 0x3c(%rsp), %eax
movl %eax, 0x7c(%rsp)
jmp 0x629b
jmp 0x629d
leaq 0x48(%rsp), %rdi
callq 0x8f90
jmp 0x61bd
jmp 0x62ae
leaq 0x68(%rsp), %rdi
callq 0x8670
jmp 0x6161
leaq 0x80(%rsp), %rsi
leaq 0x1dfbc(%rip), %rdi     # 0x24288
callq 0x7fd0
movl 0x7c(%rsp), %eax
movl %eax, 0xc(%rsp)
movslq 0x80(%rsp), %rsi
leaq 0x1df88(%rip), %rdi     # 0x24270
callq 0x84b0
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
jmp 0x60f0
movq 0x1dcd9(%rip), %rdi     # 0x23fd8
leaq 0x13f8f(%rip), %rsi     # 0x1a295
callq 0x21a0
movq %rax, %rdi
movq 0x1dcb3(%rip), %rsi     # 0x23fc8
callq 0x21d0
leaq 0x1df4f(%rip), %rdi     # 0x24270
movl $0x7, %esi
callq 0x84b0
movl (%rax), %esi
movq 0x1dca4(%rip), %rdi     # 0x23fd8
callq 0x2320
movq %rax, %rdi
leaq 0x13fac(%rip), %rsi     # 0x1a2ef
callq 0x21a0
leaq 0x1df21(%rip), %rdi     # 0x24270
movl $0x25, %esi
callq 0x84b0
movl (%rax), %esi
movq 0x1dc76(%rip), %rdi     # 0x23fd8
callq 0x2320
movq %rax, %rdi
leaq 0x13f7e(%rip), %rsi     # 0x1a2ef
callq 0x21a0
leaq 0x1def3(%rip), %rdi     # 0x24270
movl $0x3b, %esi
callq 0x84b0
movl (%rax), %esi
movq 0x1dc48(%rip), %rdi     # 0x23fd8
callq 0x2320
movq %rax, %rdi
leaq 0x13f50(%rip), %rsi     # 0x1a2ef
callq 0x21a0
leaq 0x1dec5(%rip), %rdi     # 0x24270
movl $0x52, %esi
callq 0x84b0
movl (%rax), %esi
movq 0x1dc1a(%rip), %rdi     # 0x23fd8
callq 0x2320
movq %rax, %rdi
leaq 0x13f22(%rip), %rsi     # 0x1a2ef
callq 0x21a0
leaq 0x1de97(%rip), %rdi     # 0x24270
movl $0x63, %esi
callq 0x84b0
movl (%rax), %esi
movq 0x1dbec(%rip), %rdi     # 0x23fd8
callq 0x2320
movq %rax, %rdi
leaq 0x13ef4(%rip), %rsi     # 0x1a2ef
callq 0x21a0
leaq 0x1de69(%rip), %rdi     # 0x24270
movl $0x73, %esi
callq 0x84b0
movl (%rax), %esi
movq 0x1dbbe(%rip), %rdi     # 0x23fd8
callq 0x2320
movq %rax, %rdi
leaq 0x13ec6(%rip), %rsi     # 0x1a2ef
callq 0x21a0
leaq 0x1de3b(%rip), %rdi     # 0x24270
movl $0x85, %esi
callq 0x84b0
movl (%rax), %esi
movq 0x1db90(%rip), %rdi     # 0x23fd8
callq 0x2320
movq %rax, %rdi
leaq 0x13e98(%rip), %rsi     # 0x1a2ef
callq 0x21a0
leaq 0x1de0d(%rip), %rdi     # 0x24270
movl $0xa5, %esi
callq 0x84b0
movl (%rax), %esi
movq 0x1db62(%rip), %rdi     # 0x23fd8
callq 0x2320
movq %rax, %rdi
leaq 0x13e6a(%rip), %rsi     # 0x1a2ef
callq 0x21a0
leaq 0x1dddf(%rip), %rdi     # 0x24270
movl $0xbc, %esi
callq 0x84b0
movl (%rax), %esi
movq 0x1db34(%rip), %rdi     # 0x23fd8
callq 0x2320
movq %rax, %rdi
leaq 0x13e3c(%rip), %rsi     # 0x1a2ef
callq 0x21a0
leaq 0x1ddb1(%rip), %rdi     # 0x24270
movl $0xc5, %esi
callq 0x84b0
movl (%rax), %esi
movq 0x1db06(%rip), %rdi     # 0x23fd8
callq 0x2320
movq %rax, %rdi
leaq 0x13e11(%rip), %rsi     # 0x1a2f2
callq 0x21a0
movq %rax, %rdi
movq 0x1dad8(%rip), %rsi     # 0x23fc8
callq 0x21d0
addq $0x88, %rsp
retq
nopl (%rax)