Docsity
Docsity

Prepara tus exámenes
Prepara tus exámenes

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity


Consigue puntos base para descargar
Consigue puntos base para descargar

Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium


Orientación Universidad
Orientación Universidad


Mapa de México en Matlab, Ejercicios de Inteligencia Artificial

Realización de mapa de México en el software MatLab

Tipo: Ejercicios

2019/2020

Subido el 25/01/2020

marla-aguilera
marla-aguilera 🇲🇽

2 documentos

1 / 13

Toggle sidebar

Esta página no es visible en la vista previa

¡No te pierdas las partes importantes!

bg1
UNIVERSIDAD AUTÓNOMA DE NUEVO LEÓN
FACULTAD DE INGENIERÍA MECÁNICA Y ELÉCTRICA
SEMESTRE AGOSTO DICIEMBRE 2019
INTELIGENCIA ARTIFICIAL Y REDES NEURONALES
ACTIVIDAD 5:
PROGRAMAS DE BÚSQUEDA EXHAUSTIVA O HEURÍSTICA
M.C. MARIO ÁNGEL RICO MÉNDEZ
NOMBRE: MARLA GLORIA AGUILERA NAVARRO
MATRÍCULA: 1727017
CARRERA: IMTC
GRUPO0: 005 SALÓN: 9302
HORA: N1
CIUDAD UNIVERSITARIA, SAN NICOLÁS DE LOS GARZA, N.L. A VIERNES 25 DE
OCTUBREBRE DE 2019
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Vista previa parcial del texto

¡Descarga Mapa de México en Matlab y más Ejercicios en PDF de Inteligencia Artificial solo en Docsity!

UNIVERSIDAD AUTÓNOMA DE NUEVO LEÓN

FACULTAD DE INGENIERÍA MECÁNICA Y ELÉCTRICA

SEMESTRE AGOSTO – DICIEMBRE 2019

INTELIGENCIA ARTIFICIAL Y REDES NEURONALES

ACTIVIDAD 5:

PROGRAMAS DE BÚSQUEDA EXHAUSTIVA O HEURÍSTICA

M.C. MARIO ÁNGEL RICO MÉNDEZ

NOMBRE: MARLA GLORIA AGUILERA NAVARRO

MATRÍCULA: 1727017

CARRERA: IMTC

GRUPO0: 005 SALÓN: 9302

HORA: N

CIUDAD UNIVERSITARIA, SAN NICOLÁS DE LOS GARZA, N.L. A VIERNES 25 DE

OCTUBREBRE DE 2019

INTRODUCCIÓN:

Primeramente, se tiene que saber que el software que vamos a utilizar es Matlab, debido

a que se nos presenta un problema de la situación de un vendedor, el cual tenemos como

objetivo principal encontrar un recorrido cerrado más corto pero esto mediante un

conjunto de paradas.

En este caso, tenemos 50, 100 y 200 paradas. La solución tiene varios bucles

desconectados.

end end whichIdxs = sparse(sum(whichIdxs,2)); % include trips where ii is at either Aeq(ii+1,:) = whichIdxs'; % include in the constraint matrix beq = [beq; 2ones(nStops,1)]; intcon = 1:lendist; lb = zeros(lendist,1); ub = ones(lendist,1); opts = optimoptions('intlinprog','Display','off','Heuristics','round- diving','IPPreprocess','none'); [x_tsp,costopt,exitflag,output] = intlinprog(dist,intcon,[],[],Aeq,beq,lb,ub,opts); segments = find(x_tsp); % Get indices of lines on optimal path lh = zeros(nStops,1); % Use to store handles to lines on plot lh = updateSalesmanPlot(lh,x_tsp,idxs,stopsLon,stopsLat); title('Solution with Subtours'); rng(3,'twister') % makes a plot with stops in Maine & Florida, and is reproducible nStops = 200; % you can use any number, but the problem size scales as N^ stopsLon = zeros(nStops,1); % allocate x-coordinates of nStops stopsLat = stopsLon; % allocate y-coordinates n = 1; while (n <= nStops) xp = rand1.5; yp = rand; if inpolygon(xp,yp,x,y) % test if inside the border stopsLon(n) = xp; stopsLat(n) = yp; n = n+1; end end plot(x,y,'Color','red'); % draw the outside border hold on % Add the stops to the map plot(stopsLon,stopsLat,'*b')

CONCLUSIONES:

Esta quinta actividad de la unidad de aprendizaje Inteligencia Artificial y Redes Neuronales fue

de mucho aprendizaje, ya que pude reforzar mis habilidades en el software utilizado que fue

Matlab, y sobre todo aprendí a diferenciar la búsqueda exhaustiva y heurística que

anteriormente ya habíamos visto en clase, además me pareció interesante descubrir una

utilidad más de este grandioso software que actualmente tiene mucha demanda en el mundo

laboral.

REFERENCIA BIBLIOGRÁFICA:

https://la.mathworks.com/help/optim/ug/travelling-salesman-problem.html