Summation is the common operation of adding a sequence of numbers together, resulting in their total.
The trivial implementation is to iterate over the full collection of numbers, keeping a running total as you progress.
For small sequences, a single threaded implementation will suffice, however, when the size increases use of other available CPU cores helps provide necessary speed optimisations.
As addition is an associative operation it makes no difference to the end result in which order we process the collection, this behavior works well for are implementation design.
I recently decided to test my novice C skills in the field of building a PHP extension.
However, despite some very good resources (here and here), there still seems to be a lack of beginner-friendly material on the subject.
In this post I will be documenting a simple development environment that has worked well on a fresh CentOS 6.5 installation.
Once this has been setup, we will then move on to creating a simple ‘Hello World’ extension, highlighting some of the extension platforms capabilities.
Iterative deepening depth-first search (IDDFS) is an extension to the ‘vanilla’ depth-first search algorithm, with an added constraint on the total depth explored per iteration.
This addition produces equivalent results to what can be achieved using breadth-first search, without suffering from the large memory costs.
Due to BFS’s storage of fringe vertices in memory, Od^b memory space may be required (b = branching factor), this is a stark contrast to IDDFS’s O(bd) worst-case memory requirements.
On a per-iteration interval vertex successors at the depth-cap level are ignored, and if the goal has not been found, the maximum level is increased (by one) and the processes repeated.
Similarly to BFS, it has the guarantee to find an optimal path between two subject vertices, as the shallowest goal vertex will be the depth-cap first, resulting in no exploration of subsequent, unnecessary branches.
Graph theory and in particular the graph ADT (abstract data-type) is widely explored and implemented in the field of Computer Science and Mathematics.
Consisting of vertices (nodes) and the edges (optionally directed/weighted) that connect them, the data-structure is effectively able to represent and solve many problem domains.
One of the most popular areas of algorithm design within this space is the problem of checking for the existence or (shortest) path between two or more vertices in the graph.
Whilst uploading the weekly podcast I am required to produce a list of links we discussed about on the show.
This can get a little tiresome, visiting each link and finding a suitable title.
Along with this, using Markdown you are required to provide lists in a specific format.
I had been doing this manually for a couple of weeks and last night I thought, I am a developer, I should not be doing unnecessary work.