code stringlengths 1 1.49M | vector listlengths 0 7.38k | snippet listlengths 0 7.38k |
|---|---|---|
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from GrafoBipartito import crucesEntre, crucesPorAgregarAtras
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
import random
class HeuristicaInsercionNodos(ResolvedorConstructivo):
... | [
[
1,
0,
0.0174,
0.0043,
0,
0.66,
0,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0217,
0.0043,
0,
0.66,
0.1667,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0261,
0.0043,
0,
0.66... | [
"from GrafoBipartito import ResolvedorConstructivo, Dibujo",
"from GrafoBipartito import crucesEntre, crucesPorAgregarAtras",
"from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio",
"import random",
"class HeuristicaInsercionNodos(ResolvedorConstructivo):\n\n ###############... |
#!/usr/bin/env python
"""
svg.py - Construct/display SVG scenes.
The following code is a lightweight wrapper around SVG files. The metaphor
is to construct a scene, add objects to it, and then write it to a file
to display it.
This program uses ImageMagick to display the SVG files. ImageMagick also
does a remarkable... | [
[
8,
0,
0.0542,
0.0833,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1083,
0.0083,
0,
0.66,
0.1,
688,
0,
1,
0,
0,
688,
0,
0
],
[
14,
0,
0.1167,
0.0083,
0,
0.66,
... | [
"\"\"\"\nsvg.py - Construct/display SVG scenes.\n\nThe following code is a lightweight wrapper around SVG files. The metaphor\nis to construct a scene, add objects to it, and then write it to a file\nto display it.\n\nThis program uses ImageMagick to display the SVG files. ImageMagick also",
"import os",
"displ... |
# -*- coding: cp1252 -*-
from HeuristicaDeLaMediana import *
from HeuristicaInsercionEjes import *
from HeuristicaInsercionNodosMayorGrado import *
from HeuristicaInsercionNodosMenorGrado import *
from HeuristicaInsercionNodosPrimero import *
from HeuristicaInsercionNodosRandom import *
#import psyco
#psyco.ful... | [
[
1,
0,
0.0202,
0.0101,
0,
0.66,
0,
580,
0,
1,
0,
0,
580,
0,
0
],
[
1,
0,
0.0303,
0.0101,
0,
0.66,
0.0909,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0404,
0.0101,
0,
... | [
"from HeuristicaDeLaMediana import *",
"from HeuristicaInsercionEjes import *",
"from HeuristicaInsercionNodosMayorGrado import *",
"from HeuristicaInsercionNodosMenorGrado import *",
"from HeuristicaInsercionNodosPrimero import *",
"from HeuristicaInsercionNodosRandom import *",
"def testHeuristicasAgr... |
from GrafoBipartito import *
from GeneradorGrafos import *
from Dibujador import *
from SolucionBasicaPoda import *
# grafo: todos los nodos y ejes, p1 p2 estaRel(v,u)
#dibujo: l1, l2 los nodos que no se pueden mover
class HeuristicaMediana2 (ResolvedorConstructivo):
def calcularMediana(self,each,indicesV2,e... | [
[
1,
0,
0.0052,
0.0052,
0,
0.66,
0,
16,
0,
1,
0,
0,
16,
0,
0
],
[
1,
0,
0.0104,
0.0052,
0,
0.66,
0.2,
590,
0,
1,
0,
0,
590,
0,
0
],
[
1,
0,
0.0156,
0.0052,
0,
0.66,... | [
"from GrafoBipartito import *",
"from GeneradorGrafos import *",
"from Dibujador import *",
"from SolucionBasicaPoda import *",
"class HeuristicaMediana2 (ResolvedorConstructivo):\n def calcularMediana(self,each,indicesV2,ejesDe):\n med=[]\n for each2 in ejesDe[each]:\n med += [i... |
from GrafoBipartito import *
from GeneradorGrafos import *
from Dibujador import *
# grafo: todos los nodos y ejes, p1 p2 estaRel(v,u)
#dibujo: l1, l2 los nodos que no se pueden mover
class HeuristicaInsercionEjes (ResolvedorConstructivo):
# establece el rango en el cual se puede insertar un nodo
#... | [
[
1,
0,
0.0065,
0.0065,
0,
0.66,
0,
16,
0,
1,
0,
0,
16,
0,
0
],
[
1,
0,
0.0131,
0.0065,
0,
0.66,
0.3333,
590,
0,
1,
0,
0,
590,
0,
0
],
[
1,
0,
0.0196,
0.0065,
0,
0.... | [
"from GrafoBipartito import *",
"from GeneradorGrafos import *",
"from Dibujador import *",
"class HeuristicaInsercionEjes (ResolvedorConstructivo):\n \n # establece el rango en el cual se puede insertar un nodo\n # basicamente me fijo que si el tipo esta marcado, no lo trate de poner\n # ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
class ResolvedorBasico(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.dibujo
# busco los nodos que quedan por posicionar
... | [
[
1,
0,
0.0526,
0.0132,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1184,
0.0132,
0,
0.66,
0.25,
16,
0,
2,
0,
0,
16,
0,
0
],
[
3,
0,
0.4605,
0.6447,
0,
0.66... | [
"import sys",
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"class ResolvedorBasico(ResolvedorConstructivo):\n def resolver(self):\n g = self.dibujo.g\n d = self.dibujo\n\n # busco los nodos que quedan por posicionar\n q1 = [x for x in g.p1 if not x in self.dibujo.l... |
# Heuristica de agregar nodos de a uno y a acomodarlos
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from Dibujador import DibujadorGrafoBipartito
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
class HeuristicaInsercionNodosPrimero(ResolvedorConstructivo):
def resolv... | [
[
1,
0,
0.0215,
0.0108,
0,
0.66,
0,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0323,
0.0108,
0,
0.66,
0.25,
851,
0,
1,
0,
0,
851,
0,
0
],
[
1,
0,
0.043,
0.0108,
0,
0.66,... | [
"from GrafoBipartito import ResolvedorConstructivo, Dibujo",
"from Dibujador import DibujadorGrafoBipartito",
"from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio",
"class HeuristicaInsercionNodosPrimero(ResolvedorConstructivo):\n def resolver(self):\n d = self.dibujo\... |
from GrafoBipartito import GrafoBipartito, Dibujo
from Dibujador import DibujadorGrafoBipartito
from sets import Set
# Parsea un archivo .in con una sola instancia y produce
# el dibujo asociado.
class ParserDibujoIn:
def __init__(self, archivo="Tp3.in"):
f = open(archivo, 'r')
nf1 = int(... | [
[
1,
0,
0.0103,
0.0103,
0,
0.66,
0,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0206,
0.0103,
0,
0.66,
0.2,
851,
0,
1,
0,
0,
851,
0,
0
],
[
1,
0,
0.0309,
0.0103,
0,
0.66,... | [
"from GrafoBipartito import GrafoBipartito, Dibujo",
"from Dibujador import DibujadorGrafoBipartito",
"from sets import Set",
"class ParserDibujoIn:\n def __init__(self, archivo=\"Tp3.in\"):\n f = open(archivo, 'r')\n nf1 = int(f.readline())\n fijo1 = []\n nodos1 = []\n f... |
import random
from HeuristicaInsercionEjes import *
import psyco
from psyco import *
class BusquedaLocalReInsercion(BusquedaLocal):
def _rango(self,x,pi,marcados):
if x not in marcados:
return range(len(pi)+1)
else:
posxMarcado = marcados.index(x)
... | [
[
1,
0,
0.0083,
0.0083,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0165,
0.0083,
0,
0.66,
0.2,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0248,
0.0083,
0,
0.6... | [
"import random",
"from HeuristicaInsercionEjes import *",
"import psyco",
"from psyco import *",
"class BusquedaLocalReInsercion(BusquedaLocal):\n def _rango(self,x,pi,marcados):\n if x not in marcados:\n return range(len(pi)+1)\n else:\n posxMarcado = marcados.index... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from HeuristicaInsercionEjes import *
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorSwapperConPoda(ResolvedorConstructivo):
def resolver(self):
... | [
[
1,
0,
0.0357,
0.0089,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0446,
0.0089,
0,
0.66,
0.1667,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0804,
0.0089,
0,
... | [
"import sys",
"from HeuristicaInsercionEjes import *",
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"from SolucionFuerzaBruta import cuantasCombinaciones",
"class ResolvedorSwapperConPoda(ResolvedorConstructivo):\n def resolver(self):\n g = self.dibujo.g\n d = self.dibujo\n\... |
import random
from HeuristicaInsercionEjes import *
from HeuristicaInsercionNodosMayorGrado import *
import psyco
psyco.full()
class BusquedaLocalIntercambioGreedy(BusquedaLocal):
def swapValido(self,i,j,l,marcados):
if i in marcados:
if j in marcados:
return Fal... | [
[
1,
0,
0.0082,
0.0082,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0246,
0.0082,
0,
0.66,
0.1667,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0328,
0.0082,
0,
... | [
"import random",
"from HeuristicaInsercionEjes import *",
"from HeuristicaInsercionNodosMayorGrado import *",
"import psyco",
"psyco.full()",
"class BusquedaLocalIntercambioGreedy(BusquedaLocal):\n \n def swapValido(self,i,j,l,marcados):\n if i in marcados:\n if j in marcados:\n ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
class ResolvedorSwapper(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.dibujo
# busco los nodos que quedan por posicionar
... | [
[
1,
0,
0.0396,
0.0099,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0891,
0.0099,
0,
0.66,
0.25,
16,
0,
2,
0,
0,
16,
0,
0
],
[
3,
0,
0.4653,
0.7228,
0,
0.66... | [
"import sys",
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"class ResolvedorSwapper(ResolvedorConstructivo):\n def resolver(self):\n g = self.dibujo.g\n d = self.dibujo\n\n # busco los nodos que quedan por posicionar\n q1 = [x for x in g.p1 if not x in self.dibujo.... |
from GrafoBipartito import *
from HeuristicaInsercionEjes import HeuristicaInsercionEjes
from BusquedaLocalReInsercion import *
from BusquedaLocalMix import *
from HeuristicaDeLaMediana import HeuristicaDeLaMediana
from BusquedaLocalMediana import BusquedaLocalMediana
from HeuristicaInsercionNodos import *
from ... | [
[
1,
0,
0.0189,
0.0189,
0,
0.66,
0,
16,
0,
1,
0,
0,
16,
0,
0
],
[
1,
0,
0.0377,
0.0189,
0,
0.66,
0.0769,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0566,
0.0189,
0,
0.... | [
"from GrafoBipartito import *",
"from HeuristicaInsercionEjes import HeuristicaInsercionEjes",
"from BusquedaLocalReInsercion import *",
"from BusquedaLocalMix import *",
"from HeuristicaDeLaMediana import HeuristicaDeLaMediana",
"from BusquedaLocalMediana import BusquedaLocalMediana",
"from HeuristicaI... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from sets import Set
import svg
from GrafoBipartito import GrafoBipartito, Dibujo
class DibujadorGrafoBipartito:
def __init__(self, dibujo, nombre="GrafoBipartito", height=800,marcados1=None,marcados2=None):
self.dibujo = dibujo
# calculo las dimensiones... | [
[
1,
0,
0.0312,
0.0078,
0,
0.66,
0,
842,
0,
1,
0,
0,
842,
0,
0
],
[
1,
0,
0.0469,
0.0078,
0,
0.66,
0.2,
873,
0,
1,
0,
0,
873,
0,
0
],
[
1,
0,
0.0547,
0.0078,
0,
0.6... | [
"from sets import Set",
"import svg",
"from GrafoBipartito import GrafoBipartito, Dibujo",
"class DibujadorGrafoBipartito:\n def __init__(self, dibujo, nombre=\"GrafoBipartito\", height=800,marcados1=None,marcados2=None):\n self.dibujo = dibujo\n\n # calculo las dimensiones\n self.alto... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorBasicoConPoda(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.di... | [
[
1,
0,
0.0444,
0.0111,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1,
0.0111,
0,
0.66,
0.2,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.1111,
0.0111,
0,
0.66,
... | [
"import sys",
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"from SolucionFuerzaBruta import cuantasCombinaciones",
"class ResolvedorBasicoConPoda(ResolvedorConstructivo):\n def resolver(self):\n g = self.dibujo.g\n d = self.dibujo\n\n # busco los nodos que quedan por po... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
class ResolvedorSwapper(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.dibujo
# busco los nodos que quedan por posicionar
... | [
[
1,
0,
0.0396,
0.0099,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0891,
0.0099,
0,
0.66,
0.25,
16,
0,
2,
0,
0,
16,
0,
0
],
[
3,
0,
0.4653,
0.7228,
0,
0.66... | [
"import sys",
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"class ResolvedorSwapper(ResolvedorConstructivo):\n def resolver(self):\n g = self.dibujo.g\n d = self.dibujo\n\n # busco los nodos que quedan por posicionar\n q1 = [x for x in g.p1 if not x in self.dibujo.... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from HeuristicaInsercionEjes import *
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorSwapperConPoda(ResolvedorConstructivo):
def resolver(self):
... | [
[
1,
0,
0.0357,
0.0089,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0446,
0.0089,
0,
0.66,
0.1667,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0804,
0.0089,
0,
... | [
"import sys",
"from HeuristicaInsercionEjes import *",
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"from SolucionFuerzaBruta import cuantasCombinaciones",
"class ResolvedorSwapperConPoda(ResolvedorConstructivo):\n def resolver(self):\n g = self.dibujo.g\n d = self.dibujo\n\... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import Dibujo, ResolvedorConstructivo
import sys
#import psyco
#psyco.full()
class ResolvedorFuerzaBruta(ResolvedorConstructivo):
def resolver(self):
# busco los nodos que quedan por posicionar
q1 = [x for x in self.dibujo.g.p1 if not... | [
[
1,
0,
0.0301,
0.0075,
0,
0.66,
0,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0451,
0.0075,
0,
0.66,
0.125,
509,
0,
1,
0,
0,
509,
0,
0
],
[
3,
0,
0.188,
0.218,
0,
0.66,... | [
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"import sys",
"class ResolvedorFuerzaBruta(ResolvedorConstructivo):\n def resolver(self):\n # busco los nodos que quedan por posicionar\n q1 = [x for x in self.dibujo.g.p1 if not x in self.dibujo.l1]\n q2 = [x for x in self.dib... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from GrafoBipartito import crucesEntre, crucesPorAgregarAtras
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
import random
class HeuristicaInsercionNodos(ResolvedorConstructivo):
... | [
[
1,
0,
0.0174,
0.0043,
0,
0.66,
0,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0217,
0.0043,
0,
0.66,
0.1667,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0261,
0.0043,
0,
0.66... | [
"from GrafoBipartito import ResolvedorConstructivo, Dibujo",
"from GrafoBipartito import crucesEntre, crucesPorAgregarAtras",
"from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio",
"import random",
"class HeuristicaInsercionNodos(ResolvedorConstructivo):\n\n ###############... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras
from SolucionFuerzaBruta import cuantasCombinaciones, tamArbol
class ResolvedorSwapperTa... | [
[
1,
0,
0.0109,
0.0027,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0245,
0.0027,
0,
0.66,
0.1667,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0272,
0.0027,
0,
0.... | [
"import sys",
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras",
"from SolucionFuerzaBruta import cuantasCombinaciones, tamArbol",
"class ResolvedorSwapperTablaConPoda(ResolvedorConstructivo):\n\n #######... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorSwapperTabla(Resolv... | [
[
1,
0,
0.0129,
0.0032,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.029,
0.0032,
0,
0.66,
0.1667,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0323,
0.0032,
0,
0.6... | [
"import sys",
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras",
"from SolucionFuerzaBruta import cuantasCombinaciones",
"class ResolvedorSwapperTabla(ResolvedorConstructivo):\n\n ########################... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
class ResolvedorBasico(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.dibujo
# busco los nodos que quedan por posicionar
... | [
[
1,
0,
0.0526,
0.0132,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1184,
0.0132,
0,
0.66,
0.25,
16,
0,
2,
0,
0,
16,
0,
0
],
[
3,
0,
0.4605,
0.6447,
0,
0.66... | [
"import sys",
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"class ResolvedorBasico(ResolvedorConstructivo):\n def resolver(self):\n g = self.dibujo.g\n d = self.dibujo\n\n # busco los nodos que quedan por posicionar\n q1 = [x for x in g.p1 if not x in self.dibujo.l... |
#!/usr/bin/env python
"""
svg.py - Construct/display SVG scenes.
The following code is a lightweight wrapper around SVG files. The metaphor
is to construct a scene, add objects to it, and then write it to a file
to display it.
This program uses ImageMagick to display the SVG files. ImageMagick also
does a remarkable... | [
[
8,
0,
0.0542,
0.0833,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.1083,
0.0083,
0,
0.66,
0.1,
688,
0,
1,
0,
0,
688,
0,
0
],
[
14,
0,
0.1167,
0.0083,
0,
0.66,
... | [
"\"\"\"\nsvg.py - Construct/display SVG scenes.\n\nThe following code is a lightweight wrapper around SVG files. The metaphor\nis to construct a scene, add objects to it, and then write it to a file\nto display it.\n\nThis program uses ImageMagick to display the SVG files. ImageMagick also",
"import os",
"displ... |
#! /usr/bin/env python2.4
#
# Class for profiling python code. rev 1.0 6/2/94
#
# Based on prior profile module by Sjoerd Mullender...
# which was hacked somewhat by: Guido van Rossum
#
# See profile.doc for more information
"""Class for profiling Python code."""
# Copyright 1994, by InfoSeek Corporation, all righ... | [
[
8,
0,
0.0163,
0.0016,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0621,
0.0016,
0,
0.66,
0.0714,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0637,
0.0016,
0,
0.66... | [
"\"\"\"Class for profiling Python code.\"\"\"",
"import sys",
"import os",
"import time",
"import marshal",
"from optparse import OptionParser",
"__all__ = [\"run\", \"runctx\", \"help\", \"Profile\"]",
"def run(statement, filename=None, sort=-1):\n \"\"\"Run statement under profiler optionally sav... |
#! /usr/bin/env python2.4
#
# Class for profiling python code. rev 1.0 6/2/94
#
# Based on prior profile module by Sjoerd Mullender...
# which was hacked somewhat by: Guido van Rossum
#
# See profile.doc for more information
"""Class for profiling Python code."""
# Copyright 1994, by InfoSeek Corporation, all righ... | [
[
8,
0,
0.0163,
0.0016,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0621,
0.0016,
0,
0.66,
0.0714,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0637,
0.0016,
0,
0.66... | [
"\"\"\"Class for profiling Python code.\"\"\"",
"import sys",
"import os",
"import time",
"import marshal",
"from optparse import OptionParser",
"__all__ = [\"run\", \"runctx\", \"help\", \"Profile\"]",
"def run(statement, filename=None, sort=-1):\n \"\"\"Run statement under profiler optionally sav... |
from GrafoBipartito import *
from GeneradorGrafos import *
from Dibujador import *
from SolucionBasicaPoda import *
from HeuristicaInsercionEjes import *
import random
# grafo: todos los nodos y ejes, p1 p2 estaRel(v,u)
#dibujo: l1, l2 los nodos que no se pueden mover
class HeuristicaDeLaMediana (ResolvedorCons... | [
[
1,
0,
0.0051,
0.0051,
0,
0.66,
0,
16,
0,
1,
0,
0,
16,
0,
0
],
[
1,
0,
0.0101,
0.0051,
0,
0.66,
0.1429,
590,
0,
1,
0,
0,
590,
0,
0
],
[
1,
0,
0.0152,
0.0051,
0,
0.... | [
"from GrafoBipartito import *",
"from GeneradorGrafos import *",
"from Dibujador import *",
"from SolucionBasicaPoda import *",
"from HeuristicaInsercionEjes import *",
"import random",
"class HeuristicaDeLaMediana (ResolvedorConstructivo):\n #no es la version del paper pero para la mediana, aca part... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorBasicoConPoda(ResolvedorConstructivo):
def resolver(self):
g = self.dibujo.g
d = self.di... | [
[
1,
0,
0.0444,
0.0111,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.1,
0.0111,
0,
0.66,
0.2,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.1111,
0.0111,
0,
0.66,
... | [
"import sys",
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"from SolucionFuerzaBruta import cuantasCombinaciones",
"class ResolvedorBasicoConPoda(ResolvedorConstructivo):\n def resolver(self):\n g = self.dibujo.g\n d = self.dibujo\n\n # busco los nodos que quedan por po... |
from BusquedaLocalIntercambioGreedy import *
from BusquedaLocalReInsercion import *
from HeuristicaInsercionEjes import *
class BusquedaLocalMix(BusquedaLocal):
def hallarMinimoLocal(self,dibujo,marcados1,marcados2,losEjesDe):
crucesInicial = contadorDeCruces(dibujo.l1,dibujo.l2,losEjesDe)
c... | [
[
1,
0,
0.0222,
0.0222,
0,
0.66,
0,
170,
0,
1,
0,
0,
170,
0,
0
],
[
1,
0,
0.0444,
0.0222,
0,
0.66,
0.25,
934,
0,
1,
0,
0,
934,
0,
0
],
[
1,
0,
0.0667,
0.0222,
0,
0.... | [
"from BusquedaLocalIntercambioGreedy import *",
"from BusquedaLocalReInsercion import *",
"from HeuristicaInsercionEjes import *",
"class BusquedaLocalMix(BusquedaLocal):\n def hallarMinimoLocal(self,dibujo,marcados1,marcados2,losEjesDe):\n crucesInicial = contadorDeCruces(dibujo.l1,dibujo.l2,losEje... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import Dibujo, ResolvedorConstructivo
import sys
#import psyco
#psyco.full()
class ResolvedorFuerzaBruta(ResolvedorConstructivo):
def resolver(self):
# busco los nodos que quedan por posicionar
q1 = [x for x in self.dibujo.g.p1 if not... | [
[
1,
0,
0.0301,
0.0075,
0,
0.66,
0,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0451,
0.0075,
0,
0.66,
0.125,
509,
0,
1,
0,
0,
509,
0,
0
],
[
3,
0,
0.188,
0.218,
0,
0.66,... | [
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"import sys",
"class ResolvedorFuerzaBruta(ResolvedorConstructivo):\n def resolver(self):\n # busco los nodos que quedan por posicionar\n q1 = [x for x in self.dibujo.g.p1 if not x in self.dibujo.l1]\n q2 = [x for x in self.dib... |
import random
from HeuristicaDeLaMediana import *
import psyco
psyco.full()
class BusquedaLocalMediana(BusquedaLocal):
def calcularMediana(self,each,indicesi,losEjesDe):
med = []
for each1 in losEjesDe[each]:
med.append(indicesi[each1])
med.sort()
if med == []... | [
[
1,
0,
0.0065,
0.0065,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0129,
0.0065,
0,
0.66,
0.2,
580,
0,
1,
0,
0,
580,
0,
0
],
[
1,
0,
0.0194,
0.0065,
0,
0.6... | [
"import random",
"from HeuristicaDeLaMediana import *",
"import psyco",
"psyco.full()",
"class BusquedaLocalMediana(BusquedaLocal):\n def calcularMediana(self,each,indicesi,losEjesDe):\n med = []\n for each1 in losEjesDe[each]:\n med.append(indicesi[each1])\n med.sort()\n ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from sets import Set
import svg
from GrafoBipartito import GrafoBipartito, Dibujo
class DibujadorGrafoBipartito:
def __init__(self, dibujo, nombre="GrafoBipartito", height=800,marcados1=None,marcados2=None):
self.dibujo = dibujo
# calculo las dimensiones... | [
[
1,
0,
0.0312,
0.0078,
0,
0.66,
0,
842,
0,
1,
0,
0,
842,
0,
0
],
[
1,
0,
0.0469,
0.0078,
0,
0.66,
0.2,
873,
0,
1,
0,
0,
873,
0,
0
],
[
1,
0,
0.0547,
0.0078,
0,
0.6... | [
"from sets import Set",
"import svg",
"from GrafoBipartito import GrafoBipartito, Dibujo",
"class DibujadorGrafoBipartito:\n def __init__(self, dibujo, nombre=\"GrafoBipartito\", height=800,marcados1=None,marcados2=None):\n self.dibujo = dibujo\n\n # calculo las dimensiones\n self.alto... |
# Heuristica de agregar nodos de a uno y a acomodarlos
from GrafoBipartito import ResolvedorConstructivo, Dibujo, GrafoBipartito
from Dibujador import DibujadorGrafoBipartito
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
from sets import *
class HeuristicaInsercionNodosMenorGrado(Re... | [
[
1,
0,
0.018,
0.009,
0,
0.66,
0,
16,
0,
3,
0,
0,
16,
0,
0
],
[
1,
0,
0.027,
0.009,
0,
0.66,
0.2,
851,
0,
1,
0,
0,
851,
0,
0
],
[
1,
0,
0.036,
0.009,
0,
0.66,
0... | [
"from GrafoBipartito import ResolvedorConstructivo, Dibujo, GrafoBipartito",
"from Dibujador import DibujadorGrafoBipartito",
"from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio",
"from sets import *",
"class HeuristicaInsercionNodosMenorGrado(ResolvedorConstructivo):\n de... |
from GrafoBipartito import *
from GeneradorGrafos import *
from Dibujador import *
# grafo: todos los nodos y ejes, p1 p2 estaRel(v,u)
#dibujo: l1, l2 los nodos que no se pueden mover
class HeuristicaRemocion (ResolvedorConstructivo):
def contarCrucesAcumTree(p1,p2,ejes):
if len(p1) < len(p2):
... | [
[
1,
0,
0.0049,
0.0049,
0,
0.66,
0,
16,
0,
1,
0,
0,
16,
0,
0
],
[
1,
0,
0.0097,
0.0049,
0,
0.66,
0.25,
590,
0,
1,
0,
0,
590,
0,
0
],
[
1,
0,
0.0146,
0.0049,
0,
0.66... | [
"from GrafoBipartito import *",
"from GeneradorGrafos import *",
"from Dibujador import *",
"class HeuristicaRemocion (ResolvedorConstructivo):\n def contarCrucesAcumTree(p1,p2,ejes):\n if len(p1) < len(p2):\n return contarCrucesAcumTree(p2,p1,[(y,x) for (x,y) in ejes])\n lista=[]\... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras
from SolucionFuerzaBruta import cuantasCombinaciones
class ResolvedorSwapperTabla(Resolv... | [
[
1,
0,
0.0129,
0.0032,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.029,
0.0032,
0,
0.66,
0.1667,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0323,
0.0032,
0,
0.6... | [
"import sys",
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras",
"from SolucionFuerzaBruta import cuantasCombinaciones",
"class ResolvedorSwapperTabla(ResolvedorConstructivo):\n\n ########################... |
# Heuristica de agregar nodos de a uno y a acomodarlos
from GrafoBipartito import ResolvedorConstructivo, Dibujo, GrafoBipartito
from Dibujador import DibujadorGrafoBipartito
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
from sets import *
class HeuristicaInsercionNodosMayorGrado(R... | [
[
1,
0,
0.0183,
0.0092,
0,
0.66,
0,
16,
0,
3,
0,
0,
16,
0,
0
],
[
1,
0,
0.0275,
0.0092,
0,
0.66,
0.2,
851,
0,
1,
0,
0,
851,
0,
0
],
[
1,
0,
0.0367,
0.0092,
0,
0.66,... | [
"from GrafoBipartito import ResolvedorConstructivo, Dibujo, GrafoBipartito",
"from Dibujador import DibujadorGrafoBipartito",
"from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio",
"from sets import *",
"class HeuristicaInsercionNodosMayorGrado(ResolvedorConstructivo):\n de... |
import random
from HeuristicaInsercionEjes import *
from HeuristicaInsercionNodos import *
from HeuristicaDeLaMediana import *
from SolucionSwapperTablaPoda import *
import psyco
from psyco import *
class Tp3:
def limpiarDibujo(self,d,losEjesDe):
g = d.g
marcados1 = d.l1
marcado... | [
[
1,
0,
0.0068,
0.0068,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0136,
0.0068,
0,
0.66,
0.0526,
287,
0,
1,
0,
0,
287,
0,
0
],
[
1,
0,
0.0204,
0.0068,
0,
... | [
"import random",
"from HeuristicaInsercionEjes import *",
"from HeuristicaInsercionNodos import *",
"from HeuristicaDeLaMediana import *",
"from SolucionSwapperTablaPoda import *",
"import psyco",
"from psyco import *",
"class Tp3:\n def limpiarDibujo(self,d,losEjesDe):\n g = d.g\n ma... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
#import psyco
#psyco.full()
from GrafoBipartito import Dibujo, ResolvedorConstructivo
from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras
from SolucionFuerzaBruta import cuantasCombinaciones, tamArbol
class ResolvedorSwapperTa... | [
[
1,
0,
0.0109,
0.0027,
0,
0.66,
0,
509,
0,
1,
0,
0,
509,
0,
0
],
[
1,
0,
0.0245,
0.0027,
0,
0.66,
0.1667,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0272,
0.0027,
0,
0.... | [
"import sys",
"from GrafoBipartito import Dibujo, ResolvedorConstructivo",
"from GrafoBipartito import crucesEntre, crucesPorAgregarAdelante, crucesPorAgregarAtras",
"from SolucionFuerzaBruta import cuantasCombinaciones, tamArbol",
"class ResolvedorSwapperTablaConPoda(ResolvedorConstructivo):\n\n #######... |
# Heuristica de agregar nodos de a uno y a acomodarlos
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from Dibujador import DibujadorGrafoBipartito
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
import random
class HeuristicaInsercionNodosRandom(ResolvedorConstructivo):
... | [
[
1,
0,
0.0211,
0.0105,
0,
0.66,
0,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0316,
0.0105,
0,
0.66,
0.2,
851,
0,
1,
0,
0,
851,
0,
0
],
[
1,
0,
0.0421,
0.0105,
0,
0.66,... | [
"from GrafoBipartito import ResolvedorConstructivo, Dibujo",
"from Dibujador import DibujadorGrafoBipartito",
"from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio",
"import random",
"class HeuristicaInsercionNodosRandom(ResolvedorConstructivo):\n #TODO: agregar valor alfa p... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from GrafoBipartito import ResolvedorConstructivo, Dibujo
from GrafoBipartito import crucesEntre, crucesPorAgregarAtras
from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio
import random
class HeuristicaInsercionNodos(ResolvedorConstructivo):
... | [
[
1,
0,
0.0174,
0.0043,
0,
0.66,
0,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0217,
0.0043,
0,
0.66,
0.1667,
16,
0,
2,
0,
0,
16,
0,
0
],
[
1,
0,
0.0261,
0.0043,
0,
0.66... | [
"from GrafoBipartito import ResolvedorConstructivo, Dibujo",
"from GrafoBipartito import crucesEntre, crucesPorAgregarAtras",
"from GeneradorGrafos import generarGrafoBipartitoAleatorio, generarDibujoAleatorio",
"import random",
"class HeuristicaInsercionNodos(ResolvedorConstructivo):\n\n ###############... |
import random
moda=5
for i in range(1,1000):
x=[0]*i
y = random.sample( range(i), i/2+1)
for j in range(i):
if j in y:
x[j] = moda
else:
x[j] = random.randint(0,10)
print i
for each in range(i):
print x[each]," ",
print ""
print 0
| [
[
1,
0,
0.0625,
0.0625,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.125,
0.0625,
0,
0.66,
0.3333,
881,
1,
0,
0,
0,
0,
1,
0
],
[
6,
0,
0.5312,
0.75,
0,
0.66... | [
"import random",
"moda=5",
"for i in range(1,1000):\n x=[0]*i\n y = random.sample( range(i), i/2+1)\n for j in range(i):\n if j in y:\n x[j] = moda\n else:\n x[j] = random.randint(0,10)",
" x=[0]*i",
" y = random.sample( range(i), i/2+1)",
" for j in r... |
import random
for n in range(1,30):
print "Caso"
print n," ",
print 200
x=[[0,0] for i in range(n)]
for i in range(n-1):
x[i][0] = 1
x[i][1] = 1
print x[i][0], " ", x[i][1]
print 200," ",200
print "Fin"
| [
[
1,
0,
0.0833,
0.0833,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
6,
0,
0.5833,
0.75,
0,
0.66,
0.5,
773,
3,
0,
0,
0,
0,
0,
7
],
[
8,
1,
0.3333,
0.0833,
1,
0.39,
... | [
"import random",
"for n in range(1,30):\n\tprint(\"Caso\")\n\tprint(n,\" \",)\n\tprint(200)\n\tx=[[0,0] for i in range(n)]\n\tfor i in range(n-1):\n\t\tx[i][0] = 1\n\t\tx[i][1] = 1",
"\tprint(\"Caso\")",
"\tprint(n,\" \",)",
"\tprint(200)",
"\tx=[[0,0] for i in range(n)]",
"\tfor i in range(n-1):\n\t\tx... |
for i in range(10000000):
print i+2
print 0
| [
[
6,
0,
0.5,
0.6667,
0,
0.66,
0,
826,
3,
0,
0,
0,
0,
0,
2
],
[
8,
1,
0.6667,
0.3333,
1,
0.46,
0,
535,
3,
1,
0,
0,
0,
0,
1
],
[
8,
0,
1,
0.3333,
0,
0.66,
1,
... | [
"for i in range(10000000):\n print(i+2)",
" print(i+2)",
"print(0)"
] |
from math import ceil, sqrt
class FabricaPrimos:
def __init__(self):
self.fab = FabricaCandidatos()
self.primosHastaAhora = []
def _esPrimo(self, n):
s = sqrt(n)
for each in self.primosHastaAhora:
if each > s:
return True
if n % each == 0... | [
[
1,
0,
0.0075,
0.0075,
0,
0.66,
0,
526,
0,
2,
0,
0,
526,
0,
0
],
[
3,
0,
0.109,
0.1805,
0,
0.66,
0.2,
61,
0,
3,
0,
0,
0,
0,
6
],
[
2,
1,
0.0376,
0.0226,
1,
0.96,
... | [
"from math import ceil, sqrt",
"class FabricaPrimos:\n def __init__(self):\n self.fab = FabricaCandidatos()\n self.primosHastaAhora = []\n\n def _esPrimo(self, n):\n s = sqrt(n)\n for each in self.primosHastaAhora:",
" def __init__(self):\n self.fab = FabricaCandidato... |
class Cosa:
def __init__(self, costo, valor):
self.costo = costo
self.valor = valor
def __repr__(self):
return "<Cosa de valor %s y peso %s>" % (self.valor, self.costo)
class Mochila:
def __init__(self, cosas, capacidad):
self.cosas = cosas
se... | [
[
3,
0,
0.0556,
0.0972,
0,
0.66,
0,
435,
0,
2,
0,
0,
0,
0,
0
],
[
2,
1,
0.0417,
0.0417,
1,
0.84,
0,
555,
0,
3,
0,
0,
0,
0,
0
],
[
14,
2,
0.0417,
0.0139,
2,
0.07,
... | [
"class Cosa:\n def __init__(self, costo, valor):\n self.costo = costo\n self.valor = valor\n\n def __repr__(self):\n return \"<Cosa de valor %s y peso %s>\" % (self.valor, self.costo)",
" def __init__(self, costo, valor):\n self.costo = costo\n self.valor = valor",
" ... |
#PROCEDURE KESIMO3(VAR A:VECTOR;PRIM,ULT,K:CARDINAL):INTEGER;
#VAR I,D:CARDINAL; PM:INTEGER; (* PSEUDO_MEDIANA *)
#BEGIN
#IF PRIM<ULT THEN
#PM:=CASIMEDIANA(A,PRIM,ULT);
#PIVOTE2(A,PM,PRIM,ULT,I,D);
#IF (PRIM+K-1)<I THEN RETURN KESIMO3(A,PRIM,I-1,K) END;
#IF D<=(PRIM+K-1) THEN RETURN KESIMO3(A,D,ULT,K-D+PRIM) END... | [
[
2,
0,
0.1438,
0.085,
0,
0.66,
0,
393,
0,
4,
1,
0,
0,
0,
4
],
[
4,
1,
0.1471,
0.0784,
1,
0.08,
0,
0,
0,
0,
0,
0,
0,
0,
4
],
[
14,
2,
0.1176,
0.0065,
2,
0.45,
0... | [
"def kesimo(a,prim,ult,k):\n if prim < ult:\n pm = casiMediana(a,prim,ult)\n i=0\n d=0\n (i,d)=pivote(a,pm,prim,ult,i,d)\n if prim+k < i:\n return kesimo(a,prim,i-1,k)",
" if prim < ult:\n pm = casiMediana(a,prim,ult)\n... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for data_structure.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of data_structure.
"""
import unittest
class UnionFindSet:
def __init__(self, n):
self.n = self.n
self.parent = [x for x in xrnage(n)]
self.rank = [0] * n
s... | [
[
8,
0,
0.0189,
0.0303,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0455,
0.0076,
0,
0.66,
0.125,
88,
0,
1,
0,
0,
88,
0,
0
],
[
3,
0,
0.1818,
0.25,
0,
0.66,
... | [
"\"\"\"TODO(gnefihz): DO NOT SUBMIT without one-line documentation for data_structure.\n\nTODO(gnefihz): DO NOT SUBMIT without a detailed description of data_structure.\n\"\"\"",
"import unittest",
"class UnionFindSet:\n def __init__(self, n):\n self.n = self.n\n self.parent = [x for x in xrnage(n)]\n ... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for HuffmanCode.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of HuffmanCode.
"""
import unittest
from heapq import *
class HuffmanCodeNode:
def __init__(self, code, weight):
self.code = code
self.weight = weight
self.leftChi... | [
[
8,
0,
0.0362,
0.058,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.087,
0.0145,
0,
0.66,
0.125,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.1014,
0.0145,
0,
0.66,
... | [
"\"\"\"TODO(gnefihz): DO NOT SUBMIT without one-line documentation for HuffmanCode.\n\nTODO(gnefihz): DO NOT SUBMIT without a detailed description of HuffmanCode.\n\"\"\"",
"import unittest",
"from heapq import *",
"class HuffmanCodeNode:\n def __init__(self, code, weight):\n self.code = code\n self.we... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for data_structure.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of data_structure.
"""
import unittest
"""
General Segment Tree for interval statistics.
"""
class SegmentTreeNode:
def __init__(self, begin, end):
self.begin = begin
... | [
[
8,
0,
0.0191,
0.0305,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0458,
0.0076,
0,
0.66,
0.1667,
88,
0,
1,
0,
0,
88,
0,
0
],
[
8,
0,
0.0687,
0.0229,
0,
0.66,
... | [
"\"\"\"TODO(gnefihz): DO NOT SUBMIT without one-line documentation for data_structure.\n\nTODO(gnefihz): DO NOT SUBMIT without a detailed description of data_structure.\n\"\"\"",
"import unittest",
"\"\"\"\nGeneral Segment Tree for interval statistics.\n\"\"\"",
"class SegmentTreeNode:\n def __init__(self, b... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for BST.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of BST.
"""
import unittest
"""
Binary search tree without using recursion
"""
class BST:
class Node:
def __init__(self, key, parent=None, left=None, right=None):
self.key =... | [
[
8,
0,
0.0132,
0.0211,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0263,
0.0053,
0,
0.66,
0.2,
88,
0,
1,
0,
0,
88,
0,
0
],
[
8,
0,
0.0474,
0.0158,
0,
0.66,
... | [
"\"\"\"TODO(gnefihz): DO NOT SUBMIT without one-line documentation for BST.\n\nTODO(gnefihz): DO NOT SUBMIT without a detailed description of BST.\n\"\"\"",
"import unittest",
"\"\"\"\nBinary search tree without using recursion\n\"\"\"",
"class BST:\n class Node:\n def __init__(self, key, parent=None, lef... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for DFS.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of DFS.
"""
import unittest
"""
A general back tracking search
"""
def backTracking(problem, candidate=None):
if candidate is None:
candidate = problem.getRoot()
if problem.acce... | [
[
8,
0,
0.0281,
0.0449,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0674,
0.0112,
0,
0.66,
0.1667,
88,
0,
1,
0,
0,
88,
0,
0
],
[
8,
0,
0.1011,
0.0337,
0,
0.66,
... | [
"\"\"\"TODO(gnefihz): DO NOT SUBMIT without one-line documentation for DFS.\n\nTODO(gnefihz): DO NOT SUBMIT without a detailed description of DFS.\n\"\"\"",
"import unittest",
"\"\"\"\nA general back tracking search\n\"\"\"",
"def backTracking(problem, candidate=None):\n if candidate is None:\n candidate ... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for knapsack.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of knapsack.
"""
import unittest
"""
A dynamic programing to solve 0/1 knapsack problem
dp[itemIndex][capability] =
if itemIndex == n:
values[itemIndex] | 0 (capability > w... | [
[
8,
0,
0.0152,
0.0244,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0305,
0.0061,
0,
0.66,
0.1111,
88,
0,
1,
0,
0,
88,
0,
0
],
[
8,
0,
0.0793,
0.0671,
0,
0.66,
... | [
"\"\"\"TODO(gnefihz): DO NOT SUBMIT without one-line documentation for knapsack.\n\nTODO(gnefihz): DO NOT SUBMIT without a detailed description of knapsack.\n\"\"\"",
"import unittest",
"\"\"\"\nA dynamic programing to solve 0/1 knapsack problem\ndp[itemIndex][capability] =\n if itemIndex == n:\n values[i... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for search.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of search.
"""
import unittest
from heapq import heappop, heappush
"""
Genernal Breath first search
"""
def BFS(startState, terminateState):
if startState == terminateState:
re... | [
[
8,
0,
0.0119,
0.019,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0286,
0.0048,
0,
0.66,
0.0625,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0333,
0.0048,
0,
0.66,
... | [
"\"\"\"TODO(gnefihz): DO NOT SUBMIT without one-line documentation for search.\n\nTODO(gnefihz): DO NOT SUBMIT without a detailed description of search.\n\"\"\"",
"import unittest",
"from heapq import heappop, heappush",
"\"\"\"\nGenernal Breath first search\n\"\"\"",
"def BFS(startState, terminateState):\n... |
"""
Common function use in combinatics
"""
import unittest
import math
def P(n, k):
result = 1
for i in xrange(n - k + 1, n + 1):
result = result * i;
return result
def C(n, k):
if k < 0:
return 0
if k == 0:
return 1
result = 1
if k > n - k:
k = n - k
for i in xrange(n - k + 1, n + 1... | [
[
8,
0,
0.0333,
0.05,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0833,
0.0167,
0,
0.66,
0.1,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.1,
0.0167,
0,
0.66,
0.2,... | [
"\"\"\"\nCommon function use in combinatics\n\"\"\"",
"import unittest",
"import math",
"def P(n, k):\n result = 1\n for i in xrange(n - k + 1, n + 1):\n result = result * i;\n return result",
" result = 1",
" for i in xrange(n - k + 1, n + 1):\n result = result * i;",
" result = result * ... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for kth.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of kth.
"""
import unittest
def swap(array, x, y):
array[x], array[y] = array[y], array[x]
def partition(array, start, end):
I = start + 1
J = I
pivot = start
while I < end:
... | [
[
8,
0,
0.0472,
0.0755,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0943,
0.0189,
0,
0.66,
0.1429,
88,
0,
1,
0,
0,
88,
0,
0
],
[
2,
0,
0.1415,
0.0377,
0,
0.66,
... | [
"\"\"\"TODO(gnefihz): DO NOT SUBMIT without one-line documentation for kth.\n\nTODO(gnefihz): DO NOT SUBMIT without a detailed description of kth.\n\"\"\"",
"import unittest",
"def swap(array, x, y):\n array[x], array[y] = array[y], array[x]",
" array[x], array[y] = array[y], array[x]",
"def partition(arr... |
# Kadane's algorithm consists
def max_subarray(A):
max_ending_here = max_so_far = 0
for x in A:
max_ending_here = max(0, max_ending_here + x)
max_so_far = max(max_so_far, max_ending_here)
return max_so_far
#
# A variation of the problem that does not allow zero-length
#subarrays to be returned in the ca... | [
[
2,
0,
0.2895,
0.3158,
0,
0.66,
0,
90,
0,
1,
1,
0,
0,
0,
2
],
[
14,
1,
0.2105,
0.0526,
1,
0.62,
0,
33,
1,
0,
0,
0,
0,
1,
0
],
[
6,
1,
0.3158,
0.1579,
1,
0.62,
... | [
"def max_subarray(A):\n max_ending_here = max_so_far = 0\n for x in A:\n max_ending_here = max(0, max_ending_here + x)\n max_so_far = max(max_so_far, max_ending_here)\n return max_so_far",
" max_ending_here = max_so_far = 0",
" for x in A:\n max_ending_here = max(0, max_ending_here + x)\n max_s... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for shortest_path.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of shortest_path.
"""
import unittest
from heapq import heappush, heappop
"""
Dijkstra algorithm using a binary heap
O(nlogn)
"""
def dijkstraShortestPath(array2D, source):
... | [
[
8,
0,
0.0284,
0.0455,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0682,
0.0114,
0,
0.66,
0.1,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0795,
0.0114,
0,
0.66,
... | [
"\"\"\"TODO(gnefihz): DO NOT SUBMIT without one-line documentation for shortest_path.\n\nTODO(gnefihz): DO NOT SUBMIT without a detailed description of shortest_path.\n\"\"\"",
"import unittest",
"from heapq import heappush, heappop",
"\"\"\"\nDijkstra algorithm using a binary heap\nO(nlogn)\n\"\"\"",
"def ... |
"""
Common function use in graph
"""
import unittest
import math
"""
For sparse graph
"""
class Graph:
"""
Create a graph with n node [0, n)
"""
def __init__(self, n):
self.n = n
self.adjacents = [list() for x in xrange(n)]
"""
Insert a edit x->y
"""
def insert(self, x, y):
self.adjacents[... | [
[
8,
0,
0.0089,
0.0134,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0179,
0.0045,
0,
0.66,
0.1111,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0223,
0.0045,
0,
0.66,
... | [
"\"\"\"\nCommon function use in graph\n\"\"\"",
"import unittest",
"import math",
"\"\"\"\nFor sparse graph\n\"\"\"",
"class Graph:\n \"\"\"\n Create a graph with n node [0, n)\n \"\"\"\n def __init__(self, n):\n self.n = n\n self.adjacents = [list() for x in xrange(n)]",
" \"\"\"\n Create a g... |
"""TODO(gnefihz): DO NOT SUBMIT without one-line documentation for MST.
TODO(gnefihz): DO NOT SUBMIT without a detailed description of MST.
"""
import unittest
import heapq
"""
For sparse graph
"""
class WeightGraph:
"""
Create a graph with n node [0, n)
"""
def __init__(self, n):
self.n = n
self.adj... | [
[
8,
0,
0.0156,
0.025,
0,
0.66,
0,
0,
1,
0,
0,
0,
0,
0,
0
],
[
1,
0,
0.0375,
0.0063,
0,
0.66,
0.0909,
88,
0,
1,
0,
0,
88,
0,
0
],
[
1,
0,
0.0437,
0.0063,
0,
0.66,
... | [
"\"\"\"TODO(gnefihz): DO NOT SUBMIT without one-line documentation for MST.\n\nTODO(gnefihz): DO NOT SUBMIT without a detailed description of MST.\n\"\"\"",
"import unittest",
"import heapq",
"\"\"\"\nFor sparse graph\n\"\"\"",
"class WeightGraph:\n \"\"\"\n Create a graph with n node [0, n)\n \"\"\"\n ... |
#!/usr/bin/env python
from random import randint
a = raw_input("Cantidad de nodos :")
b = raw_input("cantidad de ramas :")
f = open("p1.in", "w")
f.write(str(a)+" ")
cantcepa = int(a)-1
f.write(str(cantcepa)+"\n")
"""
for m in range(0,int(a)):
izq = 2*m+1
der = 2*m+2
if izq<int(a):
f.write( str(m)+" "+str(i... | [
[
1,
0,
0.0606,
0.0303,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.1515,
0.0303,
0,
0.66,
0.0909,
475,
3,
1,
0,
0,
821,
10,
1
],
[
14,
0,
0.1818,
0.0303,
0,
... | [
"from random import randint",
"a = raw_input(\"Cantidad de nodos :\")",
"b = raw_input(\"cantidad de ramas :\")",
"f = open(\"p1.in\", \"w\")",
"f.write(str(a)+\" \")",
"cantcepa = int(a)-1",
"f.write(str(cantcepa)+\"\\n\")",
"\"\"\"\nfor m in range(0,int(a)):\n\tizq = 2*m+1\n\tder = 2*m+2\n\n\tif izq... |
#!/usr/bin/env python
from random import randint
a = raw_input("Cantidad de nodos :")
b = raw_input("cantidad de ramas :")
f = open("p1.in", "w")
f.write(str(a)+" ")
cantcepa = int(a)-1
f.write(str(cantcepa)+"\n")
"""
for m in range(0,int(a)):
izq = 2*m+1
der = 2*m+2
if izq<int(a):
f.write( str(m)+" "+str(i... | [
[
1,
0,
0.0606,
0.0303,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.1515,
0.0303,
0,
0.66,
0.0909,
475,
3,
1,
0,
0,
821,
10,
1
],
[
14,
0,
0.1818,
0.0303,
0,
... | [
"from random import randint",
"a = raw_input(\"Cantidad de nodos :\")",
"b = raw_input(\"cantidad de ramas :\")",
"f = open(\"p1.in\", \"w\")",
"f.write(str(a)+\" \")",
"cantcepa = int(a)-1",
"f.write(str(cantcepa)+\"\\n\")",
"\"\"\"\nfor m in range(0,int(a)):\n\tizq = 2*m+1\n\tder = 2*m+2\n\n\tif izq... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
fin2=open('time_err_n3.dat')
todo=fin.read().split('\n')
todo2=fin2.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
ys2=[float(x.split()[1]) for x in todo2 if x]
yer... | [
[
1,
0,
0.1304,
0.0435,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.2174,
0.0435,
0,
0.66,
0.0556,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.2609,
0.0435,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('time_err.dat')",
"fin2=open('time_err_n3.dat')",
"todo=fin.read().split('\\n')",
"todo2=fin2.read().split('\\n')",
"xs=[float(x.split()[0]) for x in todo if x]",
"ys=[float(x.split()[1]) for x in todo if x]",
"ys2=[float(x.split()[1]) for x in todo2 if x]"... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
todo=fin.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
yerr=[float(x.split()[2]) for x in todo if x]
title("Tiempo de ejecucion de $cw$")
xlabel("Cantidad de Perso... | [
[
1,
0,
0.1667,
0.0556,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.2778,
0.0556,
0,
0.66,
0.0714,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.3333,
0.0556,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('time_err.dat')",
"todo=fin.read().split('\\n')",
"xs=[float(x.split()[0]) for x in todo if x]",
"ys=[float(x.split()[1]) for x in todo if x]",
"yerr=[float(x.split()[2]) for x in todo if x]",
"title(\"Tiempo de ejecucion de $cw$\")",
"xlabel(\"Cantidad de ... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
fin2=open('time_err_n3.dat')
todo=fin.read().split('\n')
todo2=fin2.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
ys2=[float(x.split()[1]) for x in todo2 if x]
yer... | [
[
1,
0,
0.1304,
0.0435,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.2174,
0.0435,
0,
0.66,
0.0556,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.2609,
0.0435,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('time_err.dat')",
"fin2=open('time_err_n3.dat')",
"todo=fin.read().split('\\n')",
"todo2=fin2.read().split('\\n')",
"xs=[float(x.split()[0]) for x in todo if x]",
"ys=[float(x.split()[1]) for x in todo if x]",
"ys2=[float(x.split()[1]) for x in todo2 if x]"... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('counts.dat')
todo=fin.read().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
ys=[int(x.split()[1]) for x in todo if x]
title("Cantidad de operaciones de $cw$")
xlabel("Cantidad de Personas")
ylabel("Cantidad de operaciones")
plot(xs,... | [
[
1,
0,
0.1765,
0.0588,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0.0769,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.3529,
0.0588,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('counts.dat')",
"todo=fin.read().split('\\n')",
"xs=[int(x.split()[0]) for x in todo if x]",
"ys=[int(x.split()[1]) for x in todo if x]",
"title(\"Cantidad de operaciones de $cw$\")",
"xlabel(\"Cantidad de Personas\")",
"ylabel(\"Cantidad de operaciones\")"... |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="cw"
tamanios_entrada=sorted(range(1,45)*2)
def prueba(tamanio_entrada):
out=str(tamanio_entrada)
for i in range(tamani... | [
[
1,
0,
0.0385,
0.0385,
0,
0.66,
0,
588,
0,
2,
0,
0,
588,
0,
0
],
[
1,
0,
0.0769,
0.0385,
0,
0.66,
0.1667,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1154,
0.0385,
0,
... | [
"import getopt,sys",
"import subprocess",
"from random import random,randint,seed",
"from math import sqrt",
"def prueba(tamanio_entrada):\n\tout=str(tamanio_entrada)\n\tfor i in range(tamanio_entrada):\n\t\tout+='\\n'\n\t\tli=list(set([str(x+1) for x in [randint(0,tamanio_entrada-1) for am in range(randint... |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="cw_n3"
tamanios_entrada=sorted(range(1,45)*2)
def prueba(tamanio_entrada):
out=str(tamanio_entrada)
for i in range(tam... | [
[
1,
0,
0.0385,
0.0385,
0,
0.66,
0,
588,
0,
2,
0,
0,
588,
0,
0
],
[
1,
0,
0.0769,
0.0385,
0,
0.66,
0.1667,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1154,
0.0385,
0,
... | [
"import getopt,sys",
"import subprocess",
"from random import random,randint,seed",
"from math import sqrt",
"def prueba(tamanio_entrada):\n\tout=str(tamanio_entrada)\n\tfor i in range(tamanio_entrada):\n\t\tout+='\\n'\n\t\tli=list(set([str(x+1) for x in [randint(0,tamanio_entrada-1) for am in range(randint... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin2=open('time_err_n3.dat')
todo2=fin2.read().split('\n')
xs=[float(x.split()[0]) for x in todo2 if x]
ys2=[float(x.split()[1]) for x in todo2 if x]
yerr2=[float(x.split()[2]) for x in todo2 if x]
title("Tiempo de ejecución de algoritmo cubico de $... | [
[
1,
0,
0.1667,
0.0556,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.2778,
0.0556,
0,
0.66,
0.0769,
965,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.3333,
0.0556,
0,
... | [
"from matplotlib.pyplot import *",
"fin2=open('time_err_n3.dat')",
"todo2=fin2.read().split('\\n')",
"xs=[float(x.split()[0]) for x in todo2 if x]",
"ys2=[float(x.split()[1]) for x in todo2 if x]",
"yerr2=[float(x.split()[2]) for x in todo2 if x]",
"title(\"Tiempo de ejecución de algoritmo cubico de $cw... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin2=open('time_err_n3.dat')
todo2=fin2.read().split('\n')
xs=[float(x.split()[0]) for x in todo2 if x]
ys2=[float(x.split()[1]) for x in todo2 if x]
yerr2=[float(x.split()[2]) for x in todo2 if x]
title("Tiempo de ejecución de algoritmo cubico de $... | [
[
1,
0,
0.1667,
0.0556,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.2778,
0.0556,
0,
0.66,
0.0769,
965,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.3333,
0.0556,
0,
... | [
"from matplotlib.pyplot import *",
"fin2=open('time_err_n3.dat')",
"todo2=fin2.read().split('\\n')",
"xs=[float(x.split()[0]) for x in todo2 if x]",
"ys2=[float(x.split()[1]) for x in todo2 if x]",
"yerr2=[float(x.split()[2]) for x in todo2 if x]",
"title(\"Tiempo de ejecución de algoritmo cubico de $cw... |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="cw"
tamanios_entrada=sorted(range(1,45)*2)
def prueba(tamanio_entrada):
out=str(tamanio_entrada)
for i in range(tamani... | [
[
1,
0,
0.0385,
0.0385,
0,
0.66,
0,
588,
0,
2,
0,
0,
588,
0,
0
],
[
1,
0,
0.0769,
0.0385,
0,
0.66,
0.1667,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1154,
0.0385,
0,
... | [
"import getopt,sys",
"import subprocess",
"from random import random,randint,seed",
"from math import sqrt",
"def prueba(tamanio_entrada):\n\tout=str(tamanio_entrada)\n\tfor i in range(tamanio_entrada):\n\t\tout+='\\n'\n\t\tli=list(set([str(x+1) for x in [randint(0,tamanio_entrada-1) for am in range(randint... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
todo=fin.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
yerr=[float(x.split()[2]) for x in todo if x]
title("Tiempo de ejecucion de $cw$")
xlabel("Cantidad de Perso... | [
[
1,
0,
0.1667,
0.0556,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.2778,
0.0556,
0,
0.66,
0.0714,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.3333,
0.0556,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('time_err.dat')",
"todo=fin.read().split('\\n')",
"xs=[float(x.split()[0]) for x in todo if x]",
"ys=[float(x.split()[1]) for x in todo if x]",
"yerr=[float(x.split()[2]) for x in todo if x]",
"title(\"Tiempo de ejecucion de $cw$\")",
"xlabel(\"Cantidad de ... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('counts.dat')
todo=fin.read().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
ys=[int(x.split()[1]) for x in todo if x]
title("Cantidad de operaciones de $cw$")
xlabel("Cantidad de Personas")
ylabel("Cantidad de operaciones")
plot(xs,... | [
[
1,
0,
0.1765,
0.0588,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0.0769,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.3529,
0.0588,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('counts.dat')",
"todo=fin.read().split('\\n')",
"xs=[int(x.split()[0]) for x in todo if x]",
"ys=[int(x.split()[1]) for x in todo if x]",
"title(\"Cantidad de operaciones de $cw$\")",
"xlabel(\"Cantidad de Personas\")",
"ylabel(\"Cantidad de operaciones\")"... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
todo=fin.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
yerr=[float(x.split()[2]) for x in todo if x]
title("Tiempo de ejecucion de $matching$")
xlabel("Tamano de e... | [
[
1,
0,
0.1765,
0.0588,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0.0769,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.3529,
0.0588,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('time_err.dat')",
"todo=fin.read().split('\\n')",
"xs=[float(x.split()[0]) for x in todo if x]",
"ys=[float(x.split()[1]) for x in todo if x]",
"yerr=[float(x.split()[2]) for x in todo if x]",
"title(\"Tiempo de ejecucion de $matching$\")",
"xlabel(\"Tamano... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('counts.dat')
todo=fin.read().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
ys=[int(x.split()[1]) for x in todo if x]
title("Cantidad de operaciones de $matching$")
xlabel("Tamano de entrada")
ylabel("Cantidad de operaciones")
plot(... | [
[
1,
0,
0.1875,
0.0625,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.3125,
0.0625,
0,
0.66,
0.0833,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.375,
0.0625,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('counts.dat')",
"todo=fin.read().split('\\n')",
"xs=[int(x.split()[0]) for x in todo if x]",
"ys=[int(x.split()[1]) for x in todo if x]",
"title(\"Cantidad de operaciones de $matching$\")",
"xlabel(\"Tamano de entrada\")",
"ylabel(\"Cantidad de operaciones\... |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="matching"
tamanios_entrada=sorted(range(3,300)[::5])
def prueba(tamanio_entrada):
return str(tamanio_entrada)+' '+' '.j... | [
[
1,
0,
0.0476,
0.0476,
0,
0.66,
0,
588,
0,
2,
0,
0,
588,
0,
0
],
[
1,
0,
0.0952,
0.0476,
0,
0.66,
0.1667,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1429,
0.0476,
0,
... | [
"import getopt,sys",
"import subprocess",
"from random import random,randint,seed",
"from math import sqrt",
"def prueba(tamanio_entrada):\n\treturn str(tamanio_entrada)+' '+' '.join([str(randint(0,tamanio_entrada/2)) for x in range(tamanio_entrada)])",
"\treturn str(tamanio_entrada)+' '+' '.join([str(ran... |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="matching"
tamanios_entrada=sorted(range(3,300)[::5])
def prueba(tamanio_entrada):
return str(tamanio_entrada)+' '+' '.j... | [
[
1,
0,
0.0476,
0.0476,
0,
0.66,
0,
588,
0,
2,
0,
0,
588,
0,
0
],
[
1,
0,
0.0952,
0.0476,
0,
0.66,
0.1667,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.1429,
0.0476,
0,
... | [
"import getopt,sys",
"import subprocess",
"from random import random,randint,seed",
"from math import sqrt",
"def prueba(tamanio_entrada):\n\treturn str(tamanio_entrada)+' '+' '.join([str(randint(0,tamanio_entrada/2)) for x in range(tamanio_entrada)])",
"\treturn str(tamanio_entrada)+' '+' '.join([str(ran... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
todo=fin.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
yerr=[float(x.split()[2]) for x in todo if x]
title("Tiempo de ejecucion de $matching$")
xlabel("Tamano de e... | [
[
1,
0,
0.1765,
0.0588,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0.0769,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.3529,
0.0588,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('time_err.dat')",
"todo=fin.read().split('\\n')",
"xs=[float(x.split()[0]) for x in todo if x]",
"ys=[float(x.split()[1]) for x in todo if x]",
"yerr=[float(x.split()[2]) for x in todo if x]",
"title(\"Tiempo de ejecucion de $matching$\")",
"xlabel(\"Tamano... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('counts.dat')
todo=fin.read().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
ys=[int(x.split()[1]) for x in todo if x]
title("Cantidad de operaciones de $matching$")
xlabel("Tamano de entrada")
ylabel("Cantidad de operaciones")
plot(... | [
[
1,
0,
0.1875,
0.0625,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.3125,
0.0625,
0,
0.66,
0.0833,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.375,
0.0625,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('counts.dat')",
"todo=fin.read().split('\\n')",
"xs=[int(x.split()[0]) for x in todo if x]",
"ys=[int(x.split()[1]) for x in todo if x]",
"title(\"Cantidad de operaciones de $matching$\")",
"xlabel(\"Tamano de entrada\")",
"ylabel(\"Cantidad de operaciones\... |
#!/usr/bin/env python
from Tkinter import *
from random import *
from math import sqrt
import subprocess
def prueba(tamanio_entrada):
cant=int(random()*tamanio_entrada)
w=randint(3,int(2*sqrt(tamanio_entrada)))
h=tamanio_entrada/w
vs=[]
for v in range(cant):
orient=choice(['-','|'])
if orient=='|':
l=rand... | [
[
1,
0,
0.0405,
0.0135,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
1,
0,
0.0541,
0.0135,
0,
0.66,
0.0714,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0676,
0.0135,
0,
... | [
"from Tkinter import *",
"from random import *",
"from math import sqrt",
"import subprocess",
"def prueba(tamanio_entrada):\n\tcant=int(random()*tamanio_entrada)\n\tw=randint(3,int(2*sqrt(tamanio_entrada)))\n\th=tamanio_entrada/w\n\tvs=[]\n\tfor v in range(cant):\n\t\torient=choice(['-','|'])\n\t\tif orien... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
todo=fin.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
yerr=[float(x.split()[2]) for x in todo if x]
title("Tiempo de ejecucion de $flood$")
xlabel("Tamano de entr... | [
[
1,
0,
0.1765,
0.0588,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0.0769,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.3529,
0.0588,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('time_err.dat')",
"todo=fin.read().split('\\n')",
"xs=[float(x.split()[0]) for x in todo if x]",
"ys=[float(x.split()[1]) for x in todo if x]",
"yerr=[float(x.split()[2]) for x in todo if x]",
"title(\"Tiempo de ejecucion de $flood$\")",
"xlabel(\"Tamano de... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('counts.dat')
todo=fin.read().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
ys=[int(x.split()[1]) for x in todo if x]
title("Cantidad de operaciones de $flood$")
xlabel("Tamano de entrada")
ylabel("Cantidad de operaciones")
plot(xs,... | [
[
1,
0,
0.1875,
0.0625,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.3125,
0.0625,
0,
0.66,
0.0833,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.375,
0.0625,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('counts.dat')",
"todo=fin.read().split('\\n')",
"xs=[int(x.split()[0]) for x in todo if x]",
"ys=[int(x.split()[1]) for x in todo if x]",
"title(\"Cantidad de operaciones de $flood$\")",
"xlabel(\"Tamano de entrada\")",
"ylabel(\"Cantidad de operaciones\")"... |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed,choice
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="flood"
tamanios_entrada=sorted(range(100,5000)[::35])
def prueba(tamanio_entrada):
cant=int(random()*tamanio_en... | [
[
1,
0,
0.0238,
0.0238,
0,
0.66,
0,
588,
0,
2,
0,
0,
588,
0,
0
],
[
1,
0,
0.0476,
0.0238,
0,
0.66,
0.1667,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.0714,
0.0238,
0,
... | [
"import getopt,sys",
"import subprocess",
"from random import random,randint,seed,choice",
"from math import sqrt",
"def prueba(tamanio_entrada):\n\tcant=int(random()*tamanio_entrada)\n\tw=randint(3,int(2*sqrt(tamanio_entrada)))\n\th=tamanio_entrada/w\n\tvs=[]\n\tfor v in range(cant):\n\t\torient=choice(['-... |
#!/usr/bin/env python
import getopt,sys
import subprocess
from random import random,randint,seed,choice
from math import sqrt
seed(1234) # defino el seed para hacer el experimento reproducible
ejecutable="flood"
tamanios_entrada=sorted(range(100,5000)[::35])
def prueba(tamanio_entrada):
cant=int(random()*tamanio_en... | [
[
1,
0,
0.0238,
0.0238,
0,
0.66,
0,
588,
0,
2,
0,
0,
588,
0,
0
],
[
1,
0,
0.0476,
0.0238,
0,
0.66,
0.1667,
394,
0,
1,
0,
0,
394,
0,
0
],
[
1,
0,
0.0714,
0.0238,
0,
... | [
"import getopt,sys",
"import subprocess",
"from random import random,randint,seed,choice",
"from math import sqrt",
"def prueba(tamanio_entrada):\n\tcant=int(random()*tamanio_entrada)\n\tw=randint(3,int(2*sqrt(tamanio_entrada)))\n\th=tamanio_entrada/w\n\tvs=[]\n\tfor v in range(cant):\n\t\torient=choice(['-... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('time_err.dat')
todo=fin.read().split('\n')
xs=[float(x.split()[0]) for x in todo if x]
ys=[float(x.split()[1]) for x in todo if x]
yerr=[float(x.split()[2]) for x in todo if x]
title("Tiempo de ejecucion de $flood$")
xlabel("Tamano de entr... | [
[
1,
0,
0.1765,
0.0588,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.2941,
0.0588,
0,
0.66,
0.0769,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.3529,
0.0588,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('time_err.dat')",
"todo=fin.read().split('\\n')",
"xs=[float(x.split()[0]) for x in todo if x]",
"ys=[float(x.split()[1]) for x in todo if x]",
"yerr=[float(x.split()[2]) for x in todo if x]",
"title(\"Tiempo de ejecucion de $flood$\")",
"xlabel(\"Tamano de... |
#!/usr/bin/env python
from Tkinter import *
from random import *
from math import sqrt
import subprocess
def prueba(tamanio_entrada):
cant=int(random()*tamanio_entrada)
w=randint(3,int(2*sqrt(tamanio_entrada)))
h=tamanio_entrada/w
vs=[]
for v in range(cant):
orient=choice(['-','|'])
if orient=='|':
l=rand... | [
[
1,
0,
0.0405,
0.0135,
0,
0.66,
0,
368,
0,
1,
0,
0,
368,
0,
0
],
[
1,
0,
0.0541,
0.0135,
0,
0.66,
0.0714,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.0676,
0.0135,
0,
... | [
"from Tkinter import *",
"from random import *",
"from math import sqrt",
"import subprocess",
"def prueba(tamanio_entrada):\n\tcant=int(random()*tamanio_entrada)\n\tw=randint(3,int(2*sqrt(tamanio_entrada)))\n\th=tamanio_entrada/w\n\tvs=[]\n\tfor v in range(cant):\n\t\torient=choice(['-','|'])\n\t\tif orien... |
#!/usr/bin/env python
# coding: utf-8
from matplotlib.pyplot import *
fin=open('counts.dat')
todo=fin.read().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
ys=[int(x.split()[1]) for x in todo if x]
title("Cantidad de operaciones de $flood$")
xlabel("Tamano de entrada")
ylabel("Cantidad de operaciones")
plot(xs,... | [
[
1,
0,
0.1875,
0.0625,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.3125,
0.0625,
0,
0.66,
0.0833,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.375,
0.0625,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('counts.dat')",
"todo=fin.read().split('\\n')",
"xs=[int(x.split()[0]) for x in todo if x]",
"ys=[int(x.split()[1]) for x in todo if x]",
"title(\"Cantidad de operaciones de $flood$\")",
"xlabel(\"Tamano de entrada\")",
"ylabel(\"Cantidad de operaciones\")"... |
def agPalindr(s):
n=len(s)
m=[[0 for x in range(n+1)] for y in range(n+1)]
for ini in range(2,n+1):
j,i=ini,0
while j<=n:
if s[i]==s[j-1]: m[i][j]=m[i+1][j-1]
else: m[i][j]=min(m[i][j-1],m[i+1][j])+1
j+=1
i+=1
print '\n'.join(map(lambda x:' '.join(map(str,x)),m))
return m[0][n]
f=open('palindromo.... | [
[
2,
0,
0.4062,
0.75,
0,
0.66,
0,
553,
0,
1,
1,
0,
0,
0,
10
],
[
14,
1,
0.125,
0.0625,
1,
0.34,
0,
773,
3,
1,
0,
0,
890,
10,
1
],
[
14,
1,
0.1875,
0.0625,
1,
0.34,
... | [
"def agPalindr(s):\n\tn=len(s)\n\tm=[[0 for x in range(n+1)] for y in range(n+1)]\n\tfor ini in range(2,n+1):\n\t\tj,i=ini,0\n\t\twhile j<=n:\n\t\t\tif s[i]==s[j-1]: m[i][j]=m[i+1][j-1]\n\t\t\telse: m[i][j]=min(m[i][j-1],m[i+1][j])+1",
"\tn=len(s)",
"\tm=[[0 for x in range(n+1)] for y in range(n+1)]",
"\tfor ... |
def pr(h):
print "-",' '.join(map(str,h[0]))
print "-",' '.join(map(str,h[1]))
print "-",' '.join(map(str,h[2]))
print
def solve(h,s,d,n):
if n==1:
h[d].append(h[s].pop())
#print "move el ",h[d][len(h[d])-1]," de ",s+1," a ",d+1
pr(h)
else:
solve(h,s,3-s-d,n-1)
h[d].append(h[s].pop())
#print "move el... | [
[
2,
0,
0.3947,
0.7368,
0,
0.66,
0,
37,
0,
1,
0,
0,
0,
0,
17
],
[
8,
1,
0.1053,
0.0526,
1,
0.42,
0,
535,
3,
2,
0,
0,
0,
0,
3
],
[
8,
1,
0.1579,
0.0526,
1,
0.42,
... | [
"def pr(h):\n\tprint(\"-\",' '.join(map(str,h[0])))\n\tprint(\"-\",' '.join(map(str,h[1])))\n\tprint(\"-\",' '.join(map(str,h[2])))\n\tif n==1:\n\t\th[d].append(h[s].pop())\n\t\t#print \"move el \",h[d][len(h[d])-1],\" de \",s+1,\" a \",d+1\n\t\tpr(h)",
"\tprint(\"-\",' '.join(map(str,h[0])))",
"\tprint(\"-\",'... |
def mochila(C,k):
M=[True]+[False]*k
for i in range(len(C)):
for j in reversed(range(k+1)):
M[j]=M[j] or M[j-C[i]]
print ''.join([x and '#' or '_' for x in M])
if M[k]: return True
return M[k]
print mochila([1,2,3,4,5,6],7)
| [
[
2,
0,
0.45,
0.8,
0,
0.66,
0,
797,
0,
2,
1,
0,
0,
0,
6
],
[
14,
1,
0.2,
0.1,
1,
0.57,
0,
727,
4,
0,
0,
0,
0,
0,
0
],
[
6,
1,
0.5,
0.5,
1,
0.57,
0.5,
826,
... | [
"def mochila(C,k):\n\tM=[True]+[False]*k\n\tfor i in range(len(C)):\n\t\tfor j in reversed(range(k+1)):\n\t\t\tM[j]=M[j] or M[j-C[i]]\n\t\tprint(''.join([x and '#' or '_' for x in M]))\n\t\tif M[k]: return True\n\treturn M[k]",
"\tM=[True]+[False]*k",
"\tfor i in range(len(C)):\n\t\tfor j in reversed(range(k+1)... |
def pasos(u,v):
n,m=len(u),len(v)
M1=range(m+1)
M2=[1]*(m+1)
for i in range(1,n+1):
M2[0]=i
for j in range(1,m+1):
M2[j]=min(M2[j-1]+1, M1[j]+1, M1[j-1]+(u[i-1]!=v[j-1] and 1 or 0))
M1=M2[:]
print ''.join([str(x) for x in M1])
return M1[m]
print pasos('abc','abx')
| [
[
2,
0,
0.4615,
0.8462,
0,
0.66,
0,
617,
0,
2,
1,
0,
0,
0,
9
],
[
14,
1,
0.1538,
0.0769,
1,
0.93,
0,
51,
0,
0,
0,
0,
0,
8,
2
],
[
14,
1,
0.2308,
0.0769,
1,
0.93,
... | [
"def pasos(u,v):\n\tn,m=len(u),len(v)\n\tM1=range(m+1)\n\tM2=[1]*(m+1)\n\tfor i in range(1,n+1):\n\t\tM2[0]=i\n\t\tfor j in range(1,m+1):\n\t\t\tM2[j]=min(M2[j-1]+1, M1[j]+1, M1[j-1]+(u[i-1]!=v[j-1] and 1 or 0))",
"\tn,m=len(u),len(v)",
"\tM1=range(m+1)",
"\tM2=[1]*(m+1)",
"\tfor i in range(1,n+1):\n\t\tM2[... |
from random import random,randint
from math import sqrt
def dist(a,b):
return sqrt((a[0]-b[0])**2 + (a[1]-b[1])**2)
def sumx(C):
return reduce(lambda x,y:x+y,C,0)
def mind(C):
if len(C)==2: return dist(C[0],C[1])
elif len(C)<2: return float("Inf")
C.sort(key=lambda x:x[0])
r=C[len(C)/2][0]
d1=mind(C[:len(C)/2... | [
[
1,
0,
0.0417,
0.0417,
0,
0.66,
0,
715,
0,
2,
0,
0,
715,
0,
0
],
[
1,
0,
0.0833,
0.0417,
0,
0.66,
0.1429,
526,
0,
1,
0,
0,
526,
0,
0
],
[
2,
0,
0.1875,
0.0833,
0,
... | [
"from random import random,randint",
"from math import sqrt",
"def dist(a,b):\n\treturn sqrt((a[0]-b[0])**2 + (a[1]-b[1])**2)",
"\treturn sqrt((a[0]-b[0])**2 + (a[1]-b[1])**2)",
"def sumx(C):\n\treturn reduce(lambda x,y:x+y,C,0)",
"\treturn reduce(lambda x,y:x+y,C,0)",
"def mind(C):\n\tif len(C)==2: ret... |
#!/usr/bin/env python
from matplotlib.pyplot import *
fin=open('instance80_24/data.dat')
todo=fin.read().strip().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
exacto=[int(x.split()[0]) for x in todo if x]
constru=[int(x.split()[1]) for x in todo if x]
local=[int(x.split()[2]) for x in todo if x]
tabu=[int(x.sp... | [
[
1,
0,
0.0909,
0.0455,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.1818,
0.0455,
0,
0.66,
0.0667,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.2273,
0.0455,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('instance80_24/data.dat')",
"todo=fin.read().strip().split('\\n')",
"xs=[int(x.split()[0]) for x in todo if x]",
"exacto=[int(x.split()[0]) for x in todo if x]",
"constru=[int(x.split()[1]) for x in todo if x]",
"local=[int(x.split()[2]) for x in todo if x]",... |
#!/usr/bin/env python
from matplotlib.pyplot import *
files=["exacto.out","constructiva.out","busq_local.out","tabu.out"]
data = "\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])])
todo=data.strip().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
exacto=[int(x.split(... | [
[
1,
0,
0.087,
0.0435,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.1739,
0.0435,
0,
0.66,
0.0556,
598,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.2174,
0.0435,
0,
0... | [
"from matplotlib.pyplot import *",
"files=[\"exacto.out\",\"constructiva.out\",\"busq_local.out\",\"tabu.out\"]",
"data = \"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])])",
"todo=data.strip().split('\\n')",
"xs=[int(x.split()[0]) for x in todo if x]",... |
#! /usr/bin/python
files=["exacto.out","constructiva.out","busq_local.out","tabu.out"]
f=open("data.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
| [
[
14,
0,
0.75,
0.25,
0,
0.66,
0,
598,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
1,
0.25,
0,
0.66,
1,
899,
3,
1,
0,
0,
837,
10,
9
]
] | [
"files=[\"exacto.out\",\"constructiva.out\",\"busq_local.out\",\"tabu.out\"]",
"f=open(\"data.dat\",'w').write(\"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])]))"
] |
#!/usr/bin/env python
from matplotlib.pyplot import *
files=["exacto.out","constructiva.out","busq_local.out","tabu.out"]
data = "\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])])
todo=data.strip().split('\n')
xs=[int(x.split()[0]) for x in todo if x]
exacto=[int(x.split(... | [
[
1,
0,
0.087,
0.0435,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.1739,
0.0435,
0,
0.66,
0.0556,
598,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
0.2174,
0.0435,
0,
0... | [
"from matplotlib.pyplot import *",
"files=[\"exacto.out\",\"constructiva.out\",\"busq_local.out\",\"tabu.out\"]",
"data = \"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])])",
"todo=data.strip().split('\\n')",
"xs=[int(x.split()[0]) for x in todo if x]",... |
#! /usr/bin/python
files=["exacto.out","constructiva.out","busq_local.out","tabu.out"]
f=open("data.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
| [
[
14,
0,
0.75,
0.25,
0,
0.66,
0,
598,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
1,
0.25,
0,
0.66,
1,
899,
3,
1,
0,
0,
837,
10,
9
]
] | [
"files=[\"exacto.out\",\"constructiva.out\",\"busq_local.out\",\"tabu.out\"]",
"f=open(\"data.dat\",'w').write(\"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])]))"
] |
#! /usr/bin/python
files=["constructiva.out","busq_local.out","tabu.out"]
f=open("data_big.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
| [
[
14,
0,
0.75,
0.25,
0,
0.66,
0,
598,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
1,
0.25,
0,
0.66,
1,
899,
3,
1,
0,
0,
837,
10,
9
]
] | [
"files=[\"constructiva.out\",\"busq_local.out\",\"tabu.out\"]",
"f=open(\"data_big.dat\",'w').write(\"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])]))"
] |
#!/usr/bin/env python
from matplotlib.pyplot import *
fin=open('data_big.dat')
tam=open('hard_big_tamanios')
todo=fin.read().strip().split('\n')
#xs=tam.read().split()
constru=[int(x.split()[0]) for x in todo if x]
local=[int(x.split()[1]) for x in todo if x]
xs=tabu=[int(x.split()[2]) for x in todo if x]
title("Comp... | [
[
1,
0,
0.087,
0.0435,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.1739,
0.0435,
0,
0.66,
0.0625,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.2174,
0.0435,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('data_big.dat')",
"tam=open('hard_big_tamanios')",
"todo=fin.read().strip().split('\\n')",
"constru=[int(x.split()[0]) for x in todo if x]",
"local=[int(x.split()[1]) for x in todo if x]",
"xs=tabu=[int(x.split()[2]) for x in todo if x]",
"title(\"Comparaci... |
#! /usr/bin/python
files=["constructiva.out","busq_local.out","tabu.out"]
f=open("data_big.dat",'w').write("\n".join([" ".join(map(str,z)) for z in zip(*[open(f).read().split("\n")[::3] for f in files])]))
| [
[
14,
0,
0.75,
0.25,
0,
0.66,
0,
598,
0,
0,
0,
0,
0,
5,
0
],
[
14,
0,
1,
0.25,
0,
0.66,
1,
899,
3,
1,
0,
0,
837,
10,
9
]
] | [
"files=[\"constructiva.out\",\"busq_local.out\",\"tabu.out\"]",
"f=open(\"data_big.dat\",'w').write(\"\\n\".join([\" \".join(map(str,z)) for z in zip(*[open(f).read().split(\"\\n\")[::3] for f in files])]))"
] |
#!/usr/bin/env python
from matplotlib.pyplot import *
fin=open('data_big.dat')
tam=open('hard_big_tamanios')
todo=fin.read().strip().split('\n')
#xs=tam.read().split()
constru=[int(x.split()[0]) for x in todo if x]
local=[int(x.split()[1]) for x in todo if x]
xs=tabu=[int(x.split()[2]) for x in todo if x]
title("Comp... | [
[
1,
0,
0.087,
0.0435,
0,
0.66,
0,
596,
0,
1,
0,
0,
596,
0,
0
],
[
14,
0,
0.1739,
0.0435,
0,
0.66,
0.0625,
225,
3,
1,
0,
0,
693,
10,
1
],
[
14,
0,
0.2174,
0.0435,
0,
... | [
"from matplotlib.pyplot import *",
"fin=open('data_big.dat')",
"tam=open('hard_big_tamanios')",
"todo=fin.read().strip().split('\\n')",
"constru=[int(x.split()[0]) for x in todo if x]",
"local=[int(x.split()[1]) for x in todo if x]",
"xs=tabu=[int(x.split()[2]) for x in todo if x]",
"title(\"Comparaci... |
#! /usr/bin/python
from random import randint
from random import choice
INSTANCIAS = 70
MAX_CLAUS = 300
MAX_VARS = 40
MAX_VARS_POR_CLAUS = 10
f = open("hard_big.in",'w')
clausulas=open("hard_big_tamanios",'w')
for i in xrange(INSTANCIAS):
c = randint(1,MAX_CLAUS)
clausulas.write(str(c)+"\n")
v = randint(1,MAX_VA... | [
[
1,
0,
0.0667,
0.0333,
0,
0.66,
0,
715,
0,
1,
0,
0,
715,
0,
0
],
[
1,
0,
0.1,
0.0333,
0,
0.66,
0.1,
715,
0,
1,
0,
0,
715,
0,
0
],
[
14,
0,
0.1667,
0.0333,
0,
0.66,... | [
"from random import randint",
"from random import choice",
"INSTANCIAS = 70",
"MAX_CLAUS = 300",
"MAX_VARS = 40",
"MAX_VARS_POR_CLAUS = 10",
"f = open(\"hard_big.in\",'w')",
"clausulas=open(\"hard_big_tamanios\",'w')",
"for i in xrange(INSTANCIAS):\n\tc = randint(1,MAX_CLAUS)\n\tclausulas.write(str(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.