Skip to content

Instantly share code, notes, and snippets.

View ivangolo's full-sized avatar
🏠
Working from home

Iván González ivangolo

🏠
Working from home
  • R:Solver
  • Santiago, Chile
View GitHub Profile
{% extends "dashboard/base.html" %}
{% load static %}
{% load render_bundle from webpack_loader %}
{% block css %}
{% render_bundle 'home' 'css' %}
<link href="https://releases.transloadit.com/uppy/v2.7.0/uppy.min.css" rel="stylesheet">
<style>
.content-header {
display: none;
@ivangolo
ivangolo / tree.sql
Created July 27, 2018 04:17
Creates a nested json structure from hierarchical data
with recursive categories_from_parents as
(
-- Classes with no parent, our starting point
select id, name, '{}'::int[] as parents, 0 as level
from categories
where parent_id is NULL
union all
-- Recursively find sub-classes and append them to the result-set
@ivangolo
ivangolo / dominates.cpp
Last active August 3, 2016 20:53
Pareto front domination
bool dominates(const std::vector<double> &v, const std::vector<double> &w) {
if (v == w) {
return false;
}
size_t sum = 0;
for (size_t i = 0; i < v.size(); ++i) {
sum += v[i] <= w[i];
}
return sum == v.size();
}

Técnicas de Búsqueda incompletas

Técnicas completas VS Técnicas incompletas

Técnicas Completas Técnicas Incompletas
Encuentra el óptimo global si existe Busca el óptimo local
Permite saber si no existe solución Necesita una condición de termino
Recorre todo el espacio de búsqueda Encuentra soluciones factibles rápidamente
En todas las ejecuciones entregan el mismo resultado En cada ejecución entrega resultados diferentes