Federico Lebrón

Properties of graph representations

Categories: Programming, Mathematics, Computer Science

With the incredible usefulness of graphs and the amount of algorithms to solve graph problems, it is an important issue how we represent these graphs. In this post I will introduce a couple of ways of representing graphs on a computer, together with their advantages and disadvantages. In following posts I will discuss the interesting algebraic properties of the adjacency matrix, as well as some more advanced ways of representing graphs.

We'll turn to the two most used ones: adjacency matrices and adjacency lists. These are the "canonical" way of representing graphs. Both are quite simple data structures, yet ...

Maps

Categories: Functional Programming, Computer Science

In this post I'll talk a bit about the functional programming technique called map.

The basic definition of it is easy enough: For every type a, b, given a list X of elements of type a, and a function f taking a and returning b, map f X gives you a list Y of elements of type b, where the i-th element of Y is the result of applying f to the i-th element of X.