Docsity

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

Toggle sidebar
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