<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Computer Engineer Archives - Halil Durmus</title>
	<atom:link href="https://www.halildurmus.com/tag/computer-engineer/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.halildurmus.com/tag/computer-engineer/</link>
	<description>Official Website</description>
	<lastBuildDate>Mon, 26 Oct 2020 19:30:30 +0000</lastBuildDate>
	<language>tr</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.halildurmus.com/wp-content/uploads/2020/06/1-HalilDurmusRetina-150x150.png</url>
	<title>Computer Engineer Archives - Halil Durmus</title>
	<link>https://www.halildurmus.com/tag/computer-engineer/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Dijkstra Algoritması</title>
		<link>https://www.halildurmus.com/2020/10/26/dijkstra-algoritmasi/</link>
					<comments>https://www.halildurmus.com/2020/10/26/dijkstra-algoritmasi/#respond</comments>
		
		<dc:creator><![CDATA[Halil Durmuş]]></dc:creator>
		<pubDate>Mon, 26 Oct 2020 19:30:27 +0000</pubDate>
				<category><![CDATA[Bilgisayar]]></category>
		<category><![CDATA[Genel]]></category>
		<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Computer Engineer]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Dijkstra algorithm]]></category>
		<guid isPermaLink="false">https://www.halildurmus.com/?p=3787</guid>

					<description><![CDATA[<p>Dijkstra algoritması, örneğin yol ağlarını temsil edebilen bir grafikteki düğümler arasındaki en kısa yolları bulmak için bir algoritmadır. Bilgisayar bilimcisi Edsger W. Dijkstra tarafından 1956&#8217;da tasarlandı ve üç yıl sonra yayınlandı. Algoritma birçok varyantta mevcuttur. Dijkstra algoritması en kısayolu belirlerken Greedy(Açgözlü) yaklaşımını kullanır. Yani bir düğümden diğer bir düğüme geçerken olası en iyi yerel çözümü [&#8230;]</p>
<p>The post <a href="https://www.halildurmus.com/2020/10/26/dijkstra-algoritmasi/">Dijkstra Algoritması</a> appeared first on <a href="https://www.halildurmus.com">Halil Durmus</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Dijkstra algoritması, örneğin yol ağlarını temsil edebilen bir grafikteki düğümler arasındaki en kısa yolları bulmak için bir algoritmadır. Bilgisayar bilimcisi Edsger W. Dijkstra tarafından 1956&#8217;da tasarlandı ve üç yıl sonra yayınlandı. Algoritma birçok varyantta mevcuttur.</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="375" height="497" src="https://www.halildurmus.com/wp-content/uploads/2020/08/485-Dijkstra.jpg" alt="Edsger W. Dijkstra" class="wp-image-3808" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/485-Dijkstra.jpg 375w, https://www.halildurmus.com/wp-content/uploads/2020/08/485-Dijkstra-226x300.jpg 226w" sizes="(max-width: 375px) 100vw, 375px" /></figure>



<p></p>



<p>Dijkstra algoritması en kısayolu belirlerken Greedy(Açgözlü) yaklaşımını kullanır. Yani bir düğümden diğer bir düğüme geçerken olası en iyi yerel çözümü göz önüne alır. Her seferinde bir sonraki düğüme ilerleme Greedy yaklaşımına göre yapılır.</p>



<div class="hcb_wrap"><pre class="prism undefined-numbers lang-"><code>Dijkstra(G,w,s)                            //Başlat
{
     for(each u ∈ V)  
     {
           d[u]= ∞;
           colur[u]=white;
     }
     d[s]=0;
     pred[s]=NIL;
     Q = (tüm köşeler kuyruk);
     
     while (Non-Empty(Q))        //Tüm köşeleri işle.
     {
           u=Extract-Min(Q);       //Yeni köşe bul.
           for (each v ∈ Adj[u] )
                 if(d[u] + w(u, v) &lt; d[v])
                 {
                         d[v] = d[u] + w(u,v);
                         Azaltma-Anahtarı(Q, v, d[v]);
                         pred[v] = u;
                 }
           color[u] = black;
     }
}</code></pre></div>



<p>Bu algoritmanın çalışmasını örnek bir şekil( graph ) üzerinden göstermeye çalışacağım. Bu gösterimin ardından Dijkstra algoritmasının başarısını ve eksik taraflarını tartışabiliriz.</p>



<h4 class="wp-block-heading">Aşama 0:</h4>



<p>Örneğimizde başlangıç&nbsp;düğümü (node)&nbsp;olarak s düğümünü seçtiğimizi düşünelim ve algoritmanın çalışmasını bu düğümden başlayarak gösterelim.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="481" height="324" src="https://www.halildurmus.com/wp-content/uploads/2020/08/471-Dijkstras-Algorithm.png" alt="" class="wp-image-3788" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/471-Dijkstras-Algorithm.png 481w, https://www.halildurmus.com/wp-content/uploads/2020/08/471-Dijkstras-Algorithm-300x202.png 300w" sizes="(max-width: 481px) 100vw, 481px" /></figure>



<p></p>



<p>Algoritma başlangıçta bütün düğümlere henüz erişim olmadığını kabul ederek sonsuz (&nbsp;∞) değeri atar. Yani başlangıç durumunda henüz hiçbir düğüme gidemiyoruz.</p>



<p></p>



<figure class="wp-block-image size-large"><img decoding="async" width="366" height="322" src="https://www.halildurmus.com/wp-content/uploads/2020/08/478-Initialization-Dijkstra-.png" alt="" class="wp-image-3790" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/478-Initialization-Dijkstra-.png 366w, https://www.halildurmus.com/wp-content/uploads/2020/08/478-Initialization-Dijkstra--300x264.png 300w" sizes="(max-width: 366px) 100vw, 366px" /></figure>



<p></p>



<h4 class="wp-block-heading">Aşama 1:</h4>



<p>Ardından başlangıç düğümünün komşusu olan bütün düğümleri dolaşarak bu düğümlere ulaşım mesafesini güncellenir.</p>



<p></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="481" height="324" src="https://www.halildurmus.com/wp-content/uploads/2020/08/472-Dijkstras-Algorithm.png" alt="" class="wp-image-3789" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/472-Dijkstras-Algorithm.png 481w, https://www.halildurmus.com/wp-content/uploads/2020/08/472-Dijkstras-Algorithm-300x202.png 300w" sizes="auto, (max-width: 481px) 100vw, 481px" /></figure>



<p></p>



<p>Adj[s]= {a,b}, a ve b üzerindeki düğümleri güncellenir.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="366" height="322" src="https://www.halildurmus.com/wp-content/uploads/2020/08/479-Step-1-Dijkstra-.png" alt="" class="wp-image-3792" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/479-Step-1-Dijkstra-.png 366w, https://www.halildurmus.com/wp-content/uploads/2020/08/479-Step-1-Dijkstra--300x264.png 300w" sizes="auto, (max-width: 366px) 100vw, 366px" /></figure>



<p>Bu güncelleme işleminden sonra güncellenen düğümlerin komşularını günceller ve bütün düğümler güncellenene ve şekil üzerinde yeni bir güncelleme olmayana kadar bu işlem devam eder.</p>



<h4 class="wp-block-heading">Aşama 2:</h4>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="481" height="324" src="https://www.halildurmus.com/wp-content/uploads/2020/08/473-Dijkstras-Algorithm.png" alt="" class="wp-image-3793" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/473-Dijkstras-Algorithm.png 481w, https://www.halildurmus.com/wp-content/uploads/2020/08/473-Dijkstras-Algorithm-300x202.png 300w" sizes="auto, (max-width: 481px) 100vw, 481px" /></figure>



<p></p>



<p>Aşama 1&#8217;den sonra, a öncelik kuyruğunda minimum değere sahiptir.    Adj[a]= {b, c, d} olarak, b, c, d üzerinde çalışın ve bilgileri güncelleyin.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="366" height="322" src="https://www.halildurmus.com/wp-content/uploads/2020/08/479-Step-2-Dijkstra-.png" alt="" class="wp-image-3794" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/479-Step-2-Dijkstra-.png 366w, https://www.halildurmus.com/wp-content/uploads/2020/08/479-Step-2-Dijkstra--300x264.png 300w" sizes="auto, (max-width: 366px) 100vw, 366px" /></figure>



<p></p>



<h4 class="wp-block-heading">Aşama 3:</h4>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="481" height="324" src="https://www.halildurmus.com/wp-content/uploads/2020/08/474-Dijkstras-Algorithm.png" alt="" class="wp-image-3796" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/474-Dijkstras-Algorithm.png 481w, https://www.halildurmus.com/wp-content/uploads/2020/08/474-Dijkstras-Algorithm-300x202.png 300w" sizes="auto, (max-width: 481px) 100vw, 481px" /></figure>



<p></p>



<p>Aşama 2&#8217;den sonra, b öncelik kuyruğunda minimum anahtara sahiptir. Adj[b] = {a, c} olarak a, c üzerinde çalışın ve bilgileri güncelleyin.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="366" height="322" src="https://www.halildurmus.com/wp-content/uploads/2020/08/481-Step-3-Dijkstra-.png" alt="" class="wp-image-3797" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/481-Step-3-Dijkstra-.png 366w, https://www.halildurmus.com/wp-content/uploads/2020/08/481-Step-3-Dijkstra--300x264.png 300w" sizes="auto, (max-width: 366px) 100vw, 366px" /></figure>



<h4 class="wp-block-heading">Aşama 4:</h4>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="481" height="324" src="https://www.halildurmus.com/wp-content/uploads/2020/08/475-Dijkstras-Algorithm.png" alt="" class="wp-image-3800" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/475-Dijkstras-Algorithm.png 481w, https://www.halildurmus.com/wp-content/uploads/2020/08/475-Dijkstras-Algorithm-300x202.png 300w" sizes="auto, (max-width: 481px) 100vw, 481px" /></figure>



<p></p>



<p>Aşama 3&#8217;den sonra, c öncelik kuyruğunda minimum anahtara sahiptir. Adj[c] = {d} olarak, d üzerinde çalışın ve bilgileri güncelleyin.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="366" height="322" src="https://www.halildurmus.com/wp-content/uploads/2020/08/482-Step-4-Dijkstra-.png" alt="" class="wp-image-3801" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/482-Step-4-Dijkstra-.png 366w, https://www.halildurmus.com/wp-content/uploads/2020/08/482-Step-4-Dijkstra--300x264.png 300w" sizes="auto, (max-width: 366px) 100vw, 366px" /></figure>



<h4 class="wp-block-heading">Aşama 5:</h4>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="481" height="324" src="https://www.halildurmus.com/wp-content/uploads/2020/08/476-Dijkstras-Algorithm.png" alt="" class="wp-image-3802" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/476-Dijkstras-Algorithm.png 481w, https://www.halildurmus.com/wp-content/uploads/2020/08/476-Dijkstras-Algorithm-300x202.png 300w" sizes="auto, (max-width: 481px) 100vw, 481px" /></figure>



<p></p>



<p>Aşama 4&#8217;den sonra, d öncelik kuyruğunda minimum anahtara sahiptir. Adj[d] = {c} olarak, c üzerinde çalışın ve bilgileri güncelleyin.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="366" height="261" src="https://www.halildurmus.com/wp-content/uploads/2020/08/483-Step-5-Dijkstra-.png" alt="" class="wp-image-3803" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/483-Step-5-Dijkstra-.png 366w, https://www.halildurmus.com/wp-content/uploads/2020/08/483-Step-5-Dijkstra--300x214.png 300w" sizes="auto, (max-width: 366px) 100vw, 366px" /></figure>



<p style="font-size:18px"><strong>En Kısa Yol Ağacı</strong>: </p>



<p style="font-size:18px"><em>T = (V, A),</em></p>



<p style="font-size:18px"><em>A = {(pred[v], v) | v ∈ V \ {s}}</em></p>



<p>Pred[d] dizisi ağacı inşa etmek için kullanılır.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="481" height="324" src="https://www.halildurmus.com/wp-content/uploads/2020/08/477-Dijkstras-Algorithm.png" alt="" class="wp-image-3804" srcset="https://www.halildurmus.com/wp-content/uploads/2020/08/477-Dijkstras-Algorithm.png 481w, https://www.halildurmus.com/wp-content/uploads/2020/08/477-Dijkstras-Algorithm-300x202.png 300w" sizes="auto, (max-width: 481px) 100vw, 481px" /></figure>



<p></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="292" height="122" src="https://www.halildurmus.com/wp-content/uploads/2020/08/484-Dijkstra-.png" alt="" class="wp-image-3805"/></figure>



<p></p>



<h4 class="wp-block-heading"><strong>Dijkstra Algoritmasının Zayıf Yönü</strong></h4>



<p></p>



<p>Dijkstra Algoritması&#8217; nın eksi (-) değer taşıyan bir kenar bulunması halinde başarılı çalışmaz. Bunun sebebi eksi (-) değerdeki kenarın sürekli olarak mevcut durumdan daha iyi bir sonuç üretmesi ve algoritmanın hiçbir zaman için kararlı hale gelememesidir.</p>



<p></p>



<p><strong>Kaynakça: <a href="http://www.zafercomert.com/IcerikDetay.aspx?zcms=70" target="_blank" rel="noreferrer noopener">Zafercomert</a></strong>, <strong><a href="http://bilgisayarkavramlari.sadievrenseker.com/2010/05/13/dijkstra-algoritmasi-2/#:~:text=Bilgisayar%20bilimlerinde%20kullan%C4%B1lan%20ve%20algoritmay%C4%B1,shortest%20path)%20bulmak%20i%C3%A7in%20kullan%C4%B1l%C4%B1r.&amp;text=Dijkstra%20algoritmas%C4%B1%20herhangi%20bir%20%C5%9Fekildeki,giden%20en%20k%C4%B1sa%20yolu%20hesaplar." target="_blank" rel="noreferrer noopener">Bilgisayarkavramlari</a></strong>, <strong><a href="https://www.codingame.com/playgrounds/1608/shortest-paths-with-dijkstras-algorithm/dijkstras-algorithm" target="_blank" rel="noreferrer noopener">Codingame</a></strong>, <strong><a href="https://cp-algorithms.com/graph/dijkstra.html" target="_blank" rel="noreferrer noopener">CPalgorithms</a></strong>, <a href="https://www.hackerearth.com/practice/algorithms/graphs/shortest-path-algorithms/tutorial/" target="_blank" rel="noreferrer noopener"><strong>Hackerearth</strong></a></p>
<p>The post <a href="https://www.halildurmus.com/2020/10/26/dijkstra-algoritmasi/">Dijkstra Algoritması</a> appeared first on <a href="https://www.halildurmus.com">Halil Durmus</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.halildurmus.com/2020/10/26/dijkstra-algoritmasi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
