summaryrefslogtreecommitdiffstats
path: root/_site
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-11-28 20:49:46 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-11-28 20:49:46 +0800
commitb1a2cc66bb29a04ca61d09c65355bcd18efad2d9 (patch)
tree75b72378a5912d09d974dd7cf416e149273e47f7 /_site
parentaa8888935839d85d62106c7097d2679635d09a63 (diff)
downloadwww-b1a2cc66bb29a04ca61d09c65355bcd18efad2d9.tar.gz
Improve neo4j write-up.
Diffstat (limited to '_site')
-rw-r--r--_site/archive/neo4j-a-star-search/index.html46
-rw-r--r--_site/feed.xml2
-rw-r--r--_site/posts.xml2
3 files changed, 27 insertions, 23 deletions
diff --git a/_site/archive/neo4j-a-star-search/index.html b/_site/archive/neo4j-a-star-search/index.html
index 826ea2c..700630d 100644
--- a/_site/archive/neo4j-a-star-search/index.html
+++ b/_site/archive/neo4j-a-star-search/index.html
@@ -43,27 +43,30 @@
<h2 class="center" id="title">NEO4J A* SEARCH</h2>
<h6 class="center">14 SEPTEMBER 2025</h5>
<br>
- <div class="twocol justify"><p>Back in 2018, we used the <a href="https://neo4j.com/" class="external" target="_blank" rel="noopener noreferrer">Neo4J</a> graph database
-to track the movement of marine vessels. We were interested in the shortest
-path a ship could take through a network of about 13,000 route points.
-Performance issues with Neo4J’s shortest-path algorithms limited our search to
-about 4,000 route points.</p>
-
-<p>A graph is a finite set of vertices, and a subset of vertex pairs known as
-edges. Edges can have weights. In the case of vessel tracking, the route points
-can be modeled as a graph with the distances between them as weights. For
-different reasons, people are interested in minimizing (or maximizing) the
-weight of a path through a set of vertices. For instance, we may want to find
-the shortest path between two ports.</p>
-
-<p>Dijkstra’s algorithm is one such algorithm that finds the shortest path between
-two vertices. The one drawback of this algorithm is that it computes all the
-shortest paths from the source to all other vertices before terminating at the
-destination vertex.</p>
-
-<p>The following enhancement, also known as the A* search, employs spherical
-distance between route points (which are on the earth’s surface) as a heuristic
-to steer the search in the direction of the destination far more quickly:</p>
+ <div class="twocol justify"><p>Back in 2018, we used <a href="https://neo4j.com/" class="external" target="_blank" rel="noopener noreferrer">Neo4J</a> graph database to track the
+movement of marine vessels. We were interested in the shortest path a ship
+could take through a network of about 13,000 route points. Algorithms based on
+graph theory, such as A* search, provide an optimal solution to this
+problem. Therefore, it was useful to model the set of route points as a graph.</p>
+
+<p>A graph is a finite set of vertices, and a subset of vertex pairs (edges).
+Edges can have weights. In the case of vessel tracking, the route points form
+the vertices of a graph; the routes between them, the edges; and the distances
+between them are the weights. For different reasons, people are interested in
+minimizing (or maximizing) the weight of a path through a set of vertices. For
+instance, we may want to find the shortest path between two ports.</p>
+
+<p>Given such a graph, an algorithm like Dijkstra’s search could compute the
+shortest path between two vertices. In fact, this was the algorithm the Neo4J
+project shipped with at the time. One drawback of Dijkstra’s algorithm is that
+it computes all the shortest paths from the source to all other vertices before
+terminating at the destination vertex. The exhaustive nature of this search
+limited our search to about 4,000 route points.</p>
+
+<p>The following enhancement to Dijkstra’s search, also known as the A* search,
+employs a heuristic to steer the search in the direction of the destination
+more quickly. In the case of our network of vessels, which are on the earth’s
+surface, spherical distance is a good candidate for a heuristic:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>package org.neo4j.graphalgo.impl;
@@ -341,6 +344,7 @@ public class ShortestPathAStar extends Algorithm&lt;ShortestPathAStar&gt; {
}
}
</code></pre></div></div>
+
<p>The heuristic function is domain-specific. If chosen wisely, it can
significantly speed up the search. In our case, we achieved a 300x speedup,
enabling us to expand our search from 4,000 to 13,000 route points. The <a href="https://github.com/neo4j-contrib/neo4j-graph-algorithms/releases/tag/3.4.0.0" class="external" target="_blank" rel="noopener noreferrer">v3.4.0</a> of the
diff --git a/_site/feed.xml b/_site/feed.xml
index 2ec857d..b997599 100644
--- a/_site/feed.xml
+++ b/_site/feed.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-11-24T21:26:24+08:00</updated><id>/feed.xml</id><title type="html">ASCIIMX | Archive</title><author><name>Wickramage Don Sadeep Madurange</name></author><entry><title type="html">Neo4J A* search</title><link href="/archive/neo4j-a-star-search/" rel="alternate" type="text/html" title="Neo4J A* search" /><published>2025-09-14T00:00:00+08:00</published><updated>2025-09-14T00:00:00+08:00</updated><id>/archive/neo4j-a-star-search</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[Back in 2018, we used the Neo4J graph database to track the movement of marine vessels. We were interested in the shortest path a ship could take through a network of about 13,000 route points. Performance issues with Neo4J’s shortest-path algorithms limited our search to about 4,000 route points.]]></summary></entry><entry><title type="html">MOSFETs</title><link href="/archive/mosfet-switches/" rel="alternate" type="text/html" title="MOSFETs" /><published>2025-06-22T00:00:00+08:00</published><updated>2025-06-22T00:00:00+08:00</updated><id>/archive/mosfet-switches</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[Recently, I needed a low-power circuit for one of my battery-operated projects. Much of the system’s power savings depended on its ability to electronically switch off components, such as servos, that draw high levels of quiescent currents. My search for a solution led me to MOSFETs, transistors capable of controlling circuits operating at voltages far above their own.]]></summary></entry><entry><title type="html">ATmega328P chips</title><link href="/archive/arduino-uno/" rel="alternate" type="text/html" title="ATmega328P chips" /><published>2025-04-10T00:00:00+08:00</published><updated>2025-04-10T00:00:00+08:00</updated><id>/archive/arduino-uno</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[This is a quick reference for wiring up ATmega328P ICs to run at 5V and 3.3V. While the 5V configuration is common, the 3.3V configuration can be useful in low-power applications and when interfacing with parts that themselves run at 3.3V. In this guide, the 5V setup is configured with a 16MHz crystal oscillator, while the 3.3V configuration makes use of an 8MHz crystal oscillator.]]></summary></entry><entry><title type="html">Bare-metal ATSAM3X8E chips</title><link href="/archive/arduino-due/" rel="alternate" type="text/html" title="Bare-metal ATSAM3X8E chips" /><published>2024-10-05T00:00:00+08:00</published><updated>2024-10-05T00:00:00+08:00</updated><id>/archive/arduino-due</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[This article is a step-by-step guide for programming bare-metal ATSAM3X8E chips found on Arduino Due boards. It also includes notes on the chip’s memory layout relevant for writing linker scripts. The steps described in this article were tested on an OpenBSD workstation.]]></summary></entry></feed> \ No newline at end of file
+<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-11-28T20:49:25+08:00</updated><id>/feed.xml</id><title type="html">ASCIIMX | Archive</title><author><name>Wickramage Don Sadeep Madurange</name></author><entry><title type="html">Neo4J A* search</title><link href="/archive/neo4j-a-star-search/" rel="alternate" type="text/html" title="Neo4J A* search" /><published>2025-09-14T00:00:00+08:00</published><updated>2025-09-14T00:00:00+08:00</updated><id>/archive/neo4j-a-star-search</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[Back in 2018, we used Neo4J graph database to track the movement of marine vessels. We were interested in the shortest path a ship could take through a network of about 13,000 route points. Algorithms based on graph theory, such as A* search, provide an optimal solution to this problem. Therefore, it was useful to model the set of route points as a graph.]]></summary></entry><entry><title type="html">MOSFETs</title><link href="/archive/mosfet-switches/" rel="alternate" type="text/html" title="MOSFETs" /><published>2025-06-22T00:00:00+08:00</published><updated>2025-06-22T00:00:00+08:00</updated><id>/archive/mosfet-switches</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[Recently, I needed a low-power circuit for one of my battery-operated projects. Much of the system’s power savings depended on its ability to electronically switch off components, such as servos, that draw high levels of quiescent currents. My search for a solution led me to MOSFETs, transistors capable of controlling circuits operating at voltages far above their own.]]></summary></entry><entry><title type="html">ATmega328P chips</title><link href="/archive/arduino-uno/" rel="alternate" type="text/html" title="ATmega328P chips" /><published>2025-04-10T00:00:00+08:00</published><updated>2025-04-10T00:00:00+08:00</updated><id>/archive/arduino-uno</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[This is a quick reference for wiring up ATmega328P ICs to run at 5V and 3.3V. While the 5V configuration is common, the 3.3V configuration can be useful in low-power applications and when interfacing with parts that themselves run at 3.3V. In this guide, the 5V setup is configured with a 16MHz crystal oscillator, while the 3.3V configuration makes use of an 8MHz crystal oscillator.]]></summary></entry><entry><title type="html">Bare-metal ATSAM3X8E chips</title><link href="/archive/arduino-due/" rel="alternate" type="text/html" title="Bare-metal ATSAM3X8E chips" /><published>2024-10-05T00:00:00+08:00</published><updated>2024-10-05T00:00:00+08:00</updated><id>/archive/arduino-due</id><author><name>Wickramage Don Sadeep Madurange</name></author><summary type="html"><![CDATA[This article is a step-by-step guide for programming bare-metal ATSAM3X8E chips found on Arduino Due boards. It also includes notes on the chip’s memory layout relevant for writing linker scripts. The steps described in this article were tested on an OpenBSD workstation.]]></summary></entry></feed> \ No newline at end of file
diff --git a/_site/posts.xml b/_site/posts.xml
index 698f35f..8794142 100644
--- a/_site/posts.xml
+++ b/_site/posts.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/posts.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-11-24T21:26:24+08:00</updated><id>/posts.xml</id><title type="html">ASCIIMX</title><author><name>Wickramage Don Sadeep Madurange</name></author></feed> \ No newline at end of file
+<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/posts.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-11-28T20:49:25+08:00</updated><id>/posts.xml</id><title type="html">ASCIIMX</title><author><name>Wickramage Don Sadeep Madurange</name></author></feed> \ No newline at end of file