Bitmap Matrix and Undirected Graphs in Ruby

1 ยท Aaron Patterson ยท March 19, 2023, 7:33 p.m.
Iโ€™ve been working my way through Engineering a Compiler. I really enjoy the book, but one part has you build an interference graph for doing register allocation via graph coloring. An interference graph is an undirected graph, and one way you can represent an undirected graph is with a bitmap matrix. A bitmap matrix is just a matrix but the values in the matrix can only be 1 or 0. If every node in your graph maps to an index, you can use the bitmap matrix to represent edges in the graph. I made ...