class TestGrafo(unittest.TestCase): def setUp(self): def process_data(data): final_data = [] for i in range(len(data)): final_data.append([data[i], 1]) return final_data # Busca em profundidade grafo 1 do roteiro self.roteiro_nao_direcionado = Grafo([], []) for i in (['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11']): self.roteiro_nao_direcionado.adiciona_vertice(i) for i in (process_data([ '1-2', '1-3', '1-4', '2-3', '2-8', '2-9', '2-10', '2-11', '3-4', '3-5', '3-6', '3-7', '4-5', '4-6', '7-8', '9-10', '9-11' ])): self.roteiro_nao_direcionado.adiciona_aresta(i) # Busca em profundidade grafo 2 do roteiro self.roteiro_direcionado = Grafo([], []) for i in ([ '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13' ]): self.roteiro_direcionado.adiciona_vertice(i) for i in (process_data([ '1-2', '1-4', '1-7', '2-3', '2-6', '2-6', '3-4', '3-5', '5-2', '6-4', '6-7', '8-9', '9-10', '9-12', '10-11', '10-12', '11-6', '11-9', '13-8', '13-9', '13-12' ])): self.roteiro_direcionado.adiciona_aresta(i) # Ordenação Topológica SLIDE self.slide = Grafo([], []) for i in (['2', '3', '5', '7', '8', '9', '10', '11']): self.slide.adiciona_vertice(i) for i in (process_data([ '7-8', '7-11', '3-11', '5-8', '5-10', '8-9', '11-2', '11-9', '11-10' ])): self.slide.adiciona_aresta(i) # Ordenação Topológica TECNOLOGIA EM CONSTRUÇÃO DE EDIFÍCIOS self.edificios = Grafo([], []) for i in ([ '11', '12', '13', '14', '15', '16', '17', '18', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '37', '38', '41', '42', '43', '44', '45', '46', '47', '51', '52', '53', '54', '55', '56', '57', '61', '62', '63', '64', '65', '66', '67', '68', '71', '72', '73', '74', '75', '76' ]): self.edificios.adiciona_vertice(i) for i in (process_data([ '15-21', '14-23', '11-24', '17-24', '15-25', '17-26', '17-27', '15-32', '21-32', '21-33', '15-34', '23-35', '26-36', '23-37', '24-38', '17-41', '21-41', '17-42', '21-42', '11-43', '23-43', '35-43', '35-45', '17-46', '32-46', '21-47', '37-51', '45-51', '46-52', '51-52', '17-53', '32-53', '47-54', '17-55', '32-55', '46-56', '43-57', '31-62', '57-62', '37-64', '45-64', '22-66', '31-67', '57-67', '13-71', '22-71' ])): self.edificios.adiciona_aresta(i) # Ordenação Topológica LICENCIATURA EM FÍSICA self.fisica = Grafo([], []) for i in ([ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '37', '41', '42', '43', '44', '45', '46', '51', '52', '53', '54', '55', '56', '57', '61', '62', '63', '64', '65', '66', '68', '71', '72', '73', '74', '75', '76', '81', '82', '83', '84', '85', '86' ]): self.fisica.adiciona_vertice(i) for i in (process_data([ '11-21', '12-21', '11-22', '12-22', '12-23', '12-24', '14-24', '15-25', '21-31', '23-31', '21-32', '22-32', '23-33', '31-41', '31-42', '32-42', '33-45', '31-46', '41-51', '45-51', '41-52', '42-52', '45-53', '31-54', '43-55', '21-57', '43-57', '51-61', '51-62', '52-62', '21-63', '53-63', '51-64', '56-66', '31-68', '57-68', '61-71', '41-72', '45-72', '66-73', '31-74', '43-74', '41-76', '68-76', '65-81', '74-82', '73-83', '54-84', '71-84', '16-85', '25-85', '51-86', '76-86' ])): self.fisica.adiciona_aresta(i) # Ordenação Topológica LICENCIATURA EM MATEMÁTICA self.matematica = Grafo([], []) for i in ([ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '41', '42', '43', '44', '45', '46', '51', '52', '53', '54', '55', '56', '57', '61', '62', '63', '64', '65', '66', '67', '71', '72', '73', '74', '75', '76', '77', '81', '82', '83', '84', '85', '86', '87' ]): self.matematica.adiciona_vertice(i) for i in (process_data([ '11-21', '11-22', '13-22', '16-26', '21-31', '22-32', '12-33', '12-34', '21-41', '23-41', '23-42', '32-42', '36-43', '34-44', '27-45', '33-51', '12-52', '32-53', '44-54', '44-55', '44-57', '51-61', '52-62', '32-63', '54-64', '46-65', '57-67', '42-71', '22-72', '41-73', '42-73', '64-74', '65-75', '67-77', '62-81', '75-82', '32-83', '74-84', '77-87' ])): self.matematica.adiciona_aresta(i) # Ordenação Topológica ENGENHARIA DE COMPUTACÃO self.engenhariaDeComputacao = Grafo([], []) for i in [ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '41', '42', '43', '44', '45', '51', '52', '53', '54', '55', '61', '62', '63', '64', '65', '71', '72', '73', '74', '75', '81', '82', '83', '84', '85', '91', '92', '93', '94', '101', '102', '103' ]: self.engenhariaDeComputacao.adiciona_vertice(i) for i in process_data([ '11-21', '21-31', '21-41', '31-51', '51-61', '34-81', '35-81', '54-81', '31-52', '43-62', '24-72', '73-82', '83-92', '24-33', '24-43', '24-53', '34-63', '35-63', '63-73', '74-83', '44-93', '45-93', '92-103', '14-24', '15-24', '14-34', '15-34', '24-44', '36-44', '24-54', '31-64', '61-84', '64-84', '61-94', '75-94', '14-25', '15-25', '14-35', '15-35', '36-45', '36-55', '44-55', '55-65', '52-75', '64-75', '75-85', '16-26', '26-36' ]): self.engenhariaDeComputacao.adiciona_aresta(i) # Ordenação Topológica LETRAS self.letras = Grafo([], []) for i in [ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '37', '41', '42', '43', '44', '45', '46', '47', '51', '52', '53', '54', '55', '56', '57', '61', '62', '63', '64', '65', '66', '67', '68', '71', '72', '73', '74', '75', '76', '77', '78', '79', '81', '82', '83', '84', '85', '86', '87', '88' ]: self.letras.adiciona_vertice(i) for i in process_data([ '11-21', '21-31', '31-41', '31-51', '31-61', '31-71', '11-22', '21-32', '33-42', '35-52', '31-62', '31-72', '12-23', '21-33', '25-43', '13-53', '35-63', '31-73', '17-83', '24-34', '25-44', '36-44', '45-54', '54-64', '64-74', '74-84', '12-25', '35-25', '35-55', '35-75', '17-26', '23-46', '35-46', '22-56', '45-76', '37-47', '37-57', '37-67', '27-77', '53-77', '77-87', '54-68', '64-78', '68-78', '74-88', '78-88', '65-79' ]): self.letras.adiciona_aresta(i) # Ordenação Topológica TELEMÁTICA self.telematica = Grafo([], []) for i in [ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '37', '41', '42', '43', '44', '45', '46', '47', '51', '52', '53', '54', '55', '56', '61', '62', '63', '64', '65' ]: self.telematica.adiciona_vertice(i) for i in process_data([ '11-21', '21-31', '31-41', '41-51', '42-61', '51-61', '12-22', '16-22', '26-32', '31-42', '41-52', '53-62', '12-23', '16-23', '22-33', '23-33', '26-33', '32-43', '44-53', '13-24', '25-34', '32-44', '33-44', '44-54', '25-35', '33-45', '37-55', '41-55', '44-55', '16-26', '21-36', '24-36', '21-46', '34-46' ]): self.telematica.adiciona_aresta(i) def test_khan(self): self.assertEqual(['3', '5', '7', '8', '11', '2', '9', '10'], self.slide.Khan([])) self.assertEqual([ '11', '12', '13', '14', '15', '16', '17', '18', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '37', '38', '41', '42', '43', '44', '45', '46', '47', '51', '52', '53', '54', '55', '56', '57', '61', '62', '63', '64', '65', '66', '67', '68', '71', '72', '73', '74', '75', '76' ], self.edificios.Khan([])) self.assertEqual([ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '37', '41', '42', '43', '44', '45', '46', '51', '52', '53', '54', '55', '56', '57', '61', '62', '63', '64', '65', '66', '68', '71', '72', '73', '74', '75', '76', '81', '82', '83', '84', '85', '86' ], self.fisica.Khan([])) self.assertEqual([ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '41', '42', '43', '44', '45', '46', '51', '52', '53', '54', '55', '56', '57', '61', '62', '63', '64', '65', '66', '67', '71', '72', '73', '74', '75', '76', '77', '81', '82', '83', '84', '85', '86', '87' ], self.matematica.Khan([])) self.assertEqual([ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '41', '42', '43', '44', '45', '51', '52', '53', '54', '55', '61', '62', '63', '64', '65', '71', '72', '73', '74', '75', '81', '82', '83', '84', '85', '91', '92', '93', '94', '101', '102', '103' ], self.engenhariaDeComputacao.Khan([])) self.assertEqual([ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '26', '27', '31', '32', '33', '34', '35', '25', '36', '37', '41', '42', '43', '44', '45', '46', '47', '51', '52', '53', '54', '55', '56', '57', '61', '62', '63', '64', '65', '66', '67', '68', '71', '72', '73', '74', '75', '76', '77', '78', '79', '81', '82', '83', '84', '85', '86', '87', '88' ], self.letras.Khan([])) self.assertEqual([ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '37', '41', '42', '43', '44', '45', '46', '47', '51', '52', '53', '54', '55', '56', '61', '62', '63', '64', '65' ], self.telematica.Khan([]))
class TestGrafo(unittest.TestCase): def setUp(self): self.Slide = Grafo([], []) SlideVertices = ['2', '3', '5', '7', '8', '9', '10', '11'] SlideArestas = [['7-8', 1], ['7-11', 1], ['3-11', 1], ['5-8', 1], ['5-10', 1], ['8-9', 1], ['11-2', 1], ['11-9', 1], ['11-10', 1]] for v in SlideVertices: self.Slide.adiciona_vertice(v) for ed in SlideArestas: self.Slide.adiciona_aresta(ed) self.TecnologiaEmConstruçãoDeEdifícios = Grafo([], []) TecnologiaEmConstruçãoDeEdifíciosVertices = [ '11', '12', '13', '14', '15', '16', '17', '18', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '37', '38', '41', '42', '43', '44', '45', '46', '47', '51', '52', '53', '54', '55', '56', '57', '61', '62', '63', '64', '65', '66', '67', '68', '71', '72', '73', '74', '75', '76' ] TecnologiaEmConstruçãoDeEdifíciosArestas = [['15-21', 1], ['14-23', 1], ['11-24', 1], ['17-24', 1], ['15-25', 1], ['17-26', 1], ['17-27', 1], ['15-32', 1], ['21-32', 1], ['21-33', 1], ['15-34', 1], ['23-35', 1], ['26-36', 1], ['23-37', 1], ['24-38', 1], ['17-41', 1], ['21-41', 1], ['17-42', 1], ['21-42', 1], ['11-43', 1], ['23-43', 1], ['35-43', 1], ['35-45', 1], ['17-46', 1], ['32-46', 1], ['21-47', 1], ['37-51', 1], ['45-51', 1], ['46-52', 1], ['51-52', 1], ['17-53', 1], ['32-53', 1], ['47-54', 1], ['17-55', 1], ['32-55', 1], ['46-56', 1], ['43-57', 1], ['31-62', 1], ['57-62', 1], ['37-64', 1], ['45-64', 1], ['22-66', 1], ['31-67', 1], ['57-67', 1], ['13-71', 1], ['22-71', 1]] for v in TecnologiaEmConstruçãoDeEdifíciosVertices: self.TecnologiaEmConstruçãoDeEdifícios.adiciona_vertice(v) for ed in TecnologiaEmConstruçãoDeEdifíciosArestas: self.TecnologiaEmConstruçãoDeEdifícios.adiciona_aresta(ed) self.LicenciaturaEmFísica = Grafo([], []) LicenciaturaEmFísicaVertices = [ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '37', '41', '42', '43', '44', '45', '46', '51', '52', '53', '54', '55', '56', '57', '61', '62', '63', '64', '65', '66', '68', '71', '72', '73', '74', '75', '76', '81', '82', '83', '84', '85', '86' ] LicenciaturaEmFísicaArestas = [['11-21', 1], ['12-21', 1], ['11-22', 1], ['12-22', 1], ['12-23', 1], ['12-24', 1], ['14-24', 1], ['15-25', 1], ['21-31', 1], ['23-31', 1], ['21-32', 1], ['22-32', 1], ['23-33', 1], ['31-41', 1], ['31-42', 1], ['32-42', 1], ['33-45', 1], ['31-46', 1], ['41-51', 1], ['45-51', 1], ['41-52', 1], ['42-52', 1], ['45-53', 1], ['31-54', 1], ['43-55', 1], ['21-57', 1], ['43-57', 1], ['51-61', 1], ['51-62', 1], ['52-62', 1], ['21-63', 1], ['53-63', 1], ['51-64', 1], ['56-66', 1], ['31-68', 1], ['57-68', 1], ['61-71', 1], ['41-72', 1], ['45-72', 1], ['66-73', 1], ['31-74', 1], ['43-74', 1], ['41-76', 1], ['68-76', 1], ['65-81', 1], ['74-82', 1], ['73-83', 1], ['54-84', 1], ['71-84', 1], ['16-85', 1], ['25-85', 1], ['51-86', 1], ['76-86', 1]] for v in LicenciaturaEmFísicaVertices: self.LicenciaturaEmFísica.adiciona_vertice(v) for ed in LicenciaturaEmFísicaArestas: self.LicenciaturaEmFísica.adiciona_aresta(ed) self.LicenciaturaEmMatemática = Grafo([], []) LicenciaturaEmMatemáticaVertices = [ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '41', '42', '43', '44', '45', '46', '51', '52', '53', '54', '55', '56', '57', '61', '62', '63', '64', '65', '66', '67', '71', '72', '73', '74', '75', '76', '77', '81', '82', '83', '84', '85', '86', '87' ] LicenciaturaEmMatemáticaArestas = [['11-21', 1], ['11-22', 1], ['13-22', 1], ['16-26', 1], ['21-31', 1], ['22-32', 1], ['12-33', 1], ['12-34', 1], ['21-41', 1], ['23-41', 1], ['23-42', 1], ['32-42', 1], ['36-43', 1], ['34-44', 1], ['27-45', 1], ['33-51', 1], ['12-52', 1], ['32-53', 1], ['44-54', 1], ['44-55', 1], ['44-57', 1], ['51-61', 1], ['52-62', 1], ['32-63', 1], ['54-64', 1], ['46-65', 1], ['57-67', 1], ['42-71', 1], ['22-72', 1], ['41-73', 1], ['42-73', 1], ['64-74', 1], ['65-75', 1], ['67-77', 1], ['62-81', 1], ['75-82', 1], ['32-83', 1], ['74-84', 1], ['77-87', 1]] for v in LicenciaturaEmMatemáticaVertices: self.LicenciaturaEmMatemática.adiciona_vertice(v) for ed in LicenciaturaEmMatemáticaArestas: self.LicenciaturaEmMatemática.adiciona_aresta(ed) self.EngenhariaDeComputacão = Grafo([], []) EngenhariaDeComputacãoVertices = [ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '41', '42', '43', '44', '45', '51', '52', '53', '54', '55', '61', '62', '63', '64', '65', '71', '72', '73', '74', '75', '81', '82', '83', '84', '85', '91', '92', '93', '94', '101', '102', '103' ] EngenhariaDeComputacãoArestas = [['11-21', 1], ['21-31', 1], ['21-41', 1], ['31-51', 1], ['51-61', 1], ['34-81', 1], ['35-81', 1], ['54-81', 1], ['31-52', 1], ['43-62', 1], ['24-72', 1], ['73-82', 1], ['83-92', 1], ['24-33', 1], ['24-43', 1], ['24-53', 1], ['34-63', 1], ['35-63', 1], ['63-73', 1], ['74-83', 1], ['44-93', 1], ['45-93', 1], ['92-103', 1], ['14-24', 1], ['15-24', 1], ['14-34', 1], ['15-34', 1], ['24-44', 1], ['36-44', 1], ['24-54', 1], ['31-64', 1], ['61-84', 1], ['64-84', 1], ['61-94', 1], ['75-94', 1], ['14-25', 1], ['15-25', 1], ['14-35', 1], ['15-35', 1], ['36-45', 1], ['36-55', 1], ['44-55', 1], ['55-65', 1], ['52-75', 1], ['64-75', 1], ['75-85', 1], ['16-26', 1], ['26-36', 1]] for v in EngenhariaDeComputacãoVertices: self.EngenhariaDeComputacão.adiciona_vertice(v) for ed in EngenhariaDeComputacãoArestas: self.EngenhariaDeComputacão.adiciona_aresta(ed) self.Letras = Grafo([], []) LetrasVertices = [ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '37', '41', '42', '43', '44', '45', '46', '47', '51', '52', '53', '54', '55', '56', '57', '61', '62', '63', '64', '65', '66', '67', '68', '71', '72', '73', '74', '75', '76', '77', '78', '79', '81', '82', '83', '84', '85', '86', '87', '88' ] LetrasArestas = [['11-21', 1], ['21-31', 1], ['31-41', 1], ['31-51', 1], ['31-61', 1], ['31-71', 1], ['11-22', 1], ['21-32', 1], ['33-42', 1], ['35-52', 1], ['31-62', 1], ['31-72', 1], ['12-23', 1], ['21-33', 1], ['25-43', 1], ['13-53', 1], ['35-63', 1], ['31-73', 1], ['17-83', 1], ['24-34', 1], ['25-44', 1], ['36-44', 1], ['45-54', 1], ['54-64', 1], ['64-74', 1], ['74-84', 1], ['12-25', 1], ['35-25', 1], ['35-55', 1], ['35-75', 1], ['17-26', 1], ['23-46', 1], ['35-46', 1], ['22-56', 1], ['45-76', 1], ['37-47', 1], ['37-57', 1], ['37-67', 1], ['27-77', 1], ['53-77', 1], ['77-87', 1], ['54-68', 1], ['64-78', 1], ['68-78', 1], ['74-88', 1], ['78-88', 1], ['65-79', 1]] for v in LetrasVertices: self.Letras.adiciona_vertice(v) for ed in LetrasArestas: self.Letras.adiciona_aresta(ed) self.Telemática = Grafo([], []) TelemáticaVertices = [ '11', '12', '13', '14', '15', '16', '17', '21', '22', '23', '24', '25', '26', '27', '31', '32', '33', '34', '35', '36', '37', '41', '42', '43', '44', '45', '46', '47', '51', '52', '53', '54', '55', '56', '61', '62', '63', '64', '65' ] TelemáticaArestas = [['11-21', 1], ['21-31', 1], ['31-41', 1], ['41-51', 1], ['42-61', 1], ['51-61', 1], ['12-22', 1], ['16-22', 1], ['26-32', 1], ['31-42', 1], ['41-52', 1], ['53-62', 1], ['12-23', 1], ['16-23', 1], ['22-33', 1], ['23-33', 1], ['26-33', 1], ['32-43', 1], ['44-53', 1], ['13-24', 1], ['25-34', 1], ['32-44', 1], ['33-44', 1], ['44-54', 1], ['25-35', 1], ['33-45', 1], ['37-55', 1], ['41-55', 1], ['44-55', 1], ['16-26', 1], ['21-36', 1], ['24-36', 1], ['21-46', 1], ['34-46', 1]] for v in TelemáticaVertices: self.Telemática.adiciona_vertice(v) for ed in TelemáticaArestas: self.Telemática.adiciona_aresta(ed) # def testKhan(self): # print(self.Slide.Khan()) # print(self.TecnologiaEmConstruçãoDeEdifícios.Khan()) # print(self.LicenciaturaEmFísica.Khan()) # print(self.LicenciaturaEmMatemática.Khan()) # print(self.EngenhariaDeComputacão.Khan()) # print(self.EngenhariaDeComputacão.Khan()) # print(self.Telemática.Khan()) def testKhan(self): self.assertEqual(self.Slide.Khan(), ['7', '3', '5', '8', '11', '10', '9', '2']) self.assertEqual(self.TecnologiaEmConstruçãoDeEdifícios.Khan(), [ '12', '16', '18', '44', '61', '63', '65', '68', '72', '73', '74', '75', '76', '15', '14', '11', '17', '31', '22', '13', '21', '23', '24', '26', '32', '35', '37', '47', '43', '45', '46', '51', '57', '25', '27', '33', '34', '36', '38', '41', '42', '52', '53', '54', '55', '56', '62', '64', '66', '67', '71' ]) self.assertEqual(self.LicenciaturaEmFísica.Khan(), [ '13', '17', '26', '27', '34', '35', '36', '37', '44', '75', '11', '12', '14', '15', '43', '56', '65', '16', '21', '22', '23', '25', '66', '31', '32', '33', '57', '73', '41', '42', '45', '54', '68', '74', '51', '52', '53', '76', '61', '71', '24', '46', '55', '62', '63', '64', '72', '81', '82', '83', '84', '85', '86' ]) self.assertEqual(self.LicenciaturaEmMatemática.Khan(), [ '14', '15', '17', '24', '25', '35', '56', '66', '76', '85', '86', '11', '13', '16', '12', '23', '36', '27', '46', '21', '22', '33', '34', '52', '65', '32', '41', '44', '51', '62', '75', '42', '54', '57', '64', '67', '74', '77', '26', '31', '43', '45', '53', '55', '61', '63', '71', '72', '73', '81', '82', '83', '84', '87' ]) self.assertEqual(self.EngenhariaDeComputacão.Khan(), [ '12', '13', '17', '22', '23', '27', '32', '42', '71', '91', '101', '102', '11', '74', '14', '15', '16', '21', '34', '35', '24', '83', '26', '31', '54', '43', '92', '63', '36', '51', '52', '73', '44', '45', '64', '61', '75', '55', '41', '81', '62', '72', '82', '33', '53', '93', '103', '84', '94', '25', '65', '85' ]) self.assertEqual(self.Telemática.Khan(), [ '14', '15', '17', '27', '47', '56', '63', '64', '65', '11', '12', '16', '13', '25', '37', '21', '22', '26', '23', '24', '34', '31', '32', '33', '41', '42', '44', '51', '53', '61', '52', '62', '43', '54', '35', '45', '55', '36', '46' ]) def testDFS(self): self.assertEqual(self.Slide.DFS(), ['7', '5', '8', '3', '11', '9', '2', '10']) self.assertEqual(self.TecnologiaEmConstruçãoDeEdifícios.DFS(), [ '31', '22', '66', '17', '27', '26', '36', '15', '34', '25', '21', '47', '54', '42', '41', '33', '32', '55', '53', '46', '56', '14', '23', '37', '35', '45', '64', '51', '52', '13', '71', '11', '43', '57', '67', '62', '24', '38', '76', '75', '74', '73', '72', '68', '65', '63', '61', '44', '18', '16', '12' ]) self.assertEqual(self.LicenciaturaEmFísica.DFS(), [ '65', '81', '56', '66', '73', '83', '43', '55', '16', '15', '25', '85', '14', '12', '24', '23', '33', '45', '53', '11', '22', '21', '63', '57', '32', '31', '74', '82', '68', '54', '46', '42', '41', '76', '72', '52', '51', '86', '64', '62', '61', '71', '84', '75', '44', '37', '36', '35', '34', '27', '26', '17', '13' ]) self.assertEqual(self.LicenciaturaEmMatemática.DFS(), [ '46', '65', '75', '82', '36', '43', '27', '45', '23', '16', '26', '13', '12', '52', '62', '81', '34', '44', '57', '67', '77', '87', '55', '54', '64', '74', '84', '33', '51', '61', '11', '22', '72', '32', '83', '63', '53', '42', '71', '21', '41', '73', '31', '86', '85', '76', '66', '56', '35', '25', '24', '17', '15', '14' ]) self.assertEqual(self.EngenhariaDeComputacão.DFS(), [ '74', '83', '92', '16', '26', '36', '45', '15', '14', '35', '25', '34', '63', '73', '82', '24', '54', '81', '44', '55', '65', '93', '53', '43', '62', '33', '72', '11', '21', '41', '31', '64', '52', '75', '85', '51', '61', '94', '84', '103', '102', '101', '91', '71', '42', '32', '27', '23', '22', '17', '13', '12' ]) self.assertEqual(self.Telemática.DFS(), [ '37', '25', '35', '34', '16', '26', '32', '43', '13', '24', '12', '23', '22', '33', '45', '44', '54', '53', '62', '11', '21', '46', '36', '31', '42', '41', '55', '52', '51', '61', '65', '64', '63', '56', '47', '27', '17', '15', '14' ])