Showing 3 out of 103 links. See a condensed link blog feed.
Bron-Kerbosch algorithm (via) on 24-12-2024 17:39
This year I've been solving Advent of Code consistently and for day 23 I had to implement a small algorithm that finds clicks in a graph. My recursive function isn't particularly clever but stands at 5 lines of code:
def find_clicks(click, nodes, edges):
for idx, node in enumerate(nodes):
if click <= edges[node]:
yield from find_clicks(click | {node}, nodes[idx + 1 :], edges)
yield click
nodes is a list of all the vertices in the graph and edges is a mapping from vertex to set of neighoubrs.
Initially, call it with find_clicks(set(), nodes, edges).
The generator yields sub-maximal clicks but this was good enough for my purposes.
I was pleasantly surprised (but not too surprised) to find later that there is an algorithm that finds maximal clicks in a graph.
Link blogging with Grav on 24-12-2024 17:22
Keeping in line with the “meta” link blogging, this link should point to a series of interactions I had with ChatGPT to help me set up a new type of page that was suitable for link blogging.
My approach to running a link blog on 24-12-2024 17:14
I enjoy the stuff that Simon writes and in his newsletter he introduced me to a concept I didn't even know: “link blogging”. I decided to give it a try and so I thought it was only fitting to start by blogging about this link of his.
At least for now, I think I'll stick to a simpler workflow to see if I enjoy link blogging and in the future I might extend the way I go about this...