2 research outputs found

    Implementasi Algoritma Firefly pada Kasus N-Queens Problem

    Get PDF
    N-Queen problem is a form of puzzle game that uses chess rules for the queen on the standard chessboard with modified size. The challenge of the n-queen problem is finding the N ( N is positive integer) queens position on the chessboard, so that no queen can attack another queen on the board in a single move. Implementation of firefly algorithm in n-queens problem in this study aims to find n-queen problem solutions and count the number of iterations to achieve the optimal solution of each queen which will then be compared with the results of Sarkar and Nag's research (2017). This study uses an experimental method with a number of N between 10 to 20 and uses a population of 15 and 1000 firefly. The results showed that the firefly algorithm is able to find all the optimal solutions for the queen's position on a chessboard with dimensions 10 to 20 in a population of 1000 firefly. The firefly algorithm can find the optimal solution fewer iterations compared to the genetic algorithm. According to the experiment, firefly algorithm shows better performance in finding the optimal solution compared to genetic algorithm.-Queen problem adalah bentuk permainan menggunakan aturan permain catur pada papan catur standard namun ukurannya dapat dimodifikasi menjadi lebih besar. Tantangan dari n-queen problem adalah bagaimana menempatkan n (n adalah bilangan bulat positif) buah queen pada papan catur berukuran nxn, dimana setiap queen tidak boleh saling memakan dengan hanya 1 langkah. Queens dapat memakan dengan arah vertical horizontal ataupun diagonal baik maju ataupun mundur satu langkah. Implementasi algoritma firefly pada n-queens problem dalam penelitian ini bertujuan untuk menemukan solusi n-queen problem berdasarkan aturan n-queen lalu menghitung jumlah iterasi yang diperoleh dari setiap solusi optimal masing-masing n ratu tersebut yang kemudian akan dikomparasikan dengan hasil penelitian Sarkar dan Nag (2017). Penelitian ini menggunakan metode eksperimen dengan jumlah N antara 10 sampai dengan 20 dan menggunakan populasi 15 dan 1000 firefly. Hasil yang diperoleh menunjukkan bahwa algoritma firefly mampu menemukan semua solusi optimal posisi ratu pada papan catur dengan dimensi 10 sampai dengan 20 pada populasi 1000 firefly. Algoritma firefly dapat menemukan solusi optimal dengan jumlah iterasi lebih sedikit dibanding dengan algoritma genetik, dengan kata lain bahwa algoritma firefly lebih baik dibanding dengan algoritma genetik dilihat dari jumlah iterasi yang dibutuhkan pada kasus yang sama

    Spawn & Merge - A programmingmodel for deterministic synchronization of distributed systems

    Get PDF
    Bestehende Ansätze zur deterministischen Ausführung führen alle Codebereiche einer Anwendung voll-deterministisch aus, was mit hohen Performancekosten und einem Verlust der Skalierbarkeit einhergeht. In dieser Arbeit wird ein Programmiermodell entwickelt, das eine skalierbare deterministische Ausführung einer verteilten Anwendung mit geringeren Performancekosten (gegenüber vollem Determinismus) ermöglicht. Dazu wird das Konzept des Determinismus auf Applikationsebene eingeführt, das im Gegensatz zu vollem Determinismus die deterministische Ausführung auf diejenigen Codebereiche beschränkt, deren nebenläufige Ausführung einen Einfluss auf das deterministische Ergebnis hat. Das darauf aufbauende Spawn & Merge Programmiermodell ermöglicht die automatisierte Entscheidung, ob die Ausführungsreihenfolge zweier Codebereiche für ein deterministisches Ergebnis beibehalten werden muss. Die Evaluation eines Prototyps für Spawn & Merge in Verteilten Systemen zeigt, dass verteilte Spawn & Merge Anwendungen, die einen hohen parallelisierbaren Anteil haben, effizient skalieren können (bis zu 100% der maximal erreichbaren Beschleunigung), während eine deterministische Ausführung der Anwendungslogik garantiert wird. Dem Performancegewinn stehen die Kosten für die Mechanismen gegenüber, die den Determinismus der Anwendung ermöglichen und sich aus den Kosten für die intern verwendete Operational Transformation (OT) und den eingeführten Wartebedingungen zusammensetzen. Der Großteil der potenziellen Wartebedingungen wird durch ein internes dynamisches Scheduling der parallel ausgeführten Anteile der Anwendung verhindert. Die verbleibenden Wartebedingungen wurden durch ein angepasstes OT-System, das eine effiziente deterministische Zusammenführung in beliebiger Reihenfolge ermöglicht, weiter reduziert. Die Höhe der OT-Kosten ergibt sich aus der Anwendung und kann einen Großteil der Ausführungszeit einnehmen (im Worst Case bis zu 97,5% in den durchgeführten Messungen), wenn viele Modifikationen an geteilten Datenstrukturen durchgeführt und häufig zu parallel ausgeführten Anteilen der Anwendung synchronisiert werden. Das liegt an der Berechnungskomplexität O(n^2) der verwendeten OT-Systeme. Die OT-Kosten sind allerdings für eine Anwendung konstant (für feste Eingabedaten). Somit sinkt der Anteil der OT-Kosten an der Gesamtlaufzeit bei steigender Parallelität. Die Eignung von Spawn & Merge für eine Anwendung ist somit abhängig vom parallelisierbaren Anteil, der Anzahl durchgeführter Modifikationen an geteilten Datenstrukturen und der Häufigkeit von Synchronisationen innerhalb der Anwendung.Existing approaches for deterministic execution run all code sections in a fully deterministic manner, resulting in high performance costs and a loss of scalability. In this thesis we develop a programming model for a scalable deterministic execution of distributed applications, which introduces less performance costs than fully deterministic systems. We introduce the concept of Application-level Determinism, which, in contrast to full determinism, limits the deterministic execution to code sections that potentially influence the deterministic result of the application when executed concurrently. Based on this concept, the Spawn & Merge programming model automates the decision whether the execution of two code segments must be kept in order to maintain a deterministic result. The evaluation of a prototype of Spawn & Merge for distributed systems shows that applications with a high share of parallelizable code can scale efficiently (achieve up to 100% of maximum speedup possible) and guarantee the deterministic and reproducible execution of the application logic. The performance gain competes with the costs for the determinism-enforcing mechanisms used by Spawn & Merge: Operational Transformation (OT) and waiting conditions introduced. The majority of potential waiting conditions is automatically dealt with by internal dynamic scheduling of the parallel parts of the application. The remaining waiting conditions are further reduced by introducing a modified OT system that allows for an efficient deterministic merge in any given order. The costs for OT depend on the application and can take up most of the execution time (up to a worst case of 97,5% in the performed measurements) when many modifications of shared data structures are performed and when there is a high amount of synchronization between the parts of the application that are executed in parallel. This is due to the computational complexity of O(n^2) for the OT systems used. However, these costs for OT are constant for an application for a given input. Thus, the share of OT on the overall application runtime reduces with rising parallelism. Therefore, the feasibility of Spawn & Merge for an application depends on the parallelizable share of the application, the amount of performed modifications of shared data structures, and the amount of internal synchronizations
    corecore