# LABİRENTTE EN KISA YOL BULMA PROBLEMİ

Labirentte en kısa yol bulma problemi algoritmalar konusunda en ilginç konulardan birisi olmuştur çünkü günlük hayatta bir çok yerde kullanıldığından bu alan çok önem kazanmıştır.Şimdi 4*4 lük bir matris üzerinde gerçeklenmsi aşağıdadır.

#include<iostream>
using namespace std;

```int **p,counter=0;
int x,y; int l=0;

/*void print(int a,int b)
{      cout<<endl<<endl;
for(int i=0;i<a;i++)
{
for(int j=0;j<b;j++)
cout<<p[i][j]<<" ";
cout<<endl;
}

}
*/
void recursive(int a,int b)
{    l++;
if(a==x-1&&b==y-1)
{
p[x-1][y-1]=1;
//     print(x-1,y-1);p[x-1][y-1]=0;
counter++;
return;
}

if(a+1<x&&p[a+1][b]==0)
{
p[a+1][b]=1;
recursive(a+1,b);
p[a+1][b]=0;
}

if(a-1>=0&&p[a-1][b]==0)
{
p[a-1][b]=1;
recursive(a-1,b);
p[a-1][b]=0;
}

if(b+1<y&&p[a][b+1]==0)
{
p[a][b+1]=1;
recursive(a,b+1);
p[a][b+1]=0;
}

if(b-1>=0&&p[a][b-1]==0)
{
p[a][b-1]=1;
recursive(a,b-1);
p[a][b-1]=0;
}
return;
}

void define(int a,int b)
{
p=new int *[a];
for(int i=0;i<b;i++)
p[i]=new int [b];
for(int i=0;i<a;i++)
for(int j=0;j<b;j++)
p[i][j]=0;p[0][0]=1;
}

main()
{

cout<<"Tahtanizin Boyutunu girin:";
cin>>x>>y;
define(x,y);
recursive(0,0);
//  print(x,y);cout<<endl<<endl;
cout<<x<<" e "<<y<<" luk bir tahtada toplam-->>"<<counter<<" Yol Bulunmustur."<<endl;
cout<<"Ve ayrica Program toplamda "<<l<<" Defa kosuyor...."<<endl<<endl<<endl;
system ("pause");
}

```

MEHMET SALİH DEVECİ

#### Mehmet Salih Deveci

I am Founder of IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress mehmetsalih.deveci@outlook.com.-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  mehmetsalih.deveci@outlook.com a mail atabilirsiniz.

### One thought on “LABİRENTTE EN KISA YOL BULMA PROBLEMİ”

• December 26, 2012 at 11:07 pm

ßenım Odewım Var da En Kısa Zamanda YardımCı oLurmuSanız SewınıRım..!