This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Cartesian coordinates per facet-panel | |
#' | |
#' This function mimics the behavior of [ggplot2::coord_cartesian()], | |
#' while supporting per-panel limits when faceted. | |
#' | |
#' @details | |
#' | |
#' A 'panel_limits' data frame may contain: | |
#' | |
#' - zero or more faceting variables, all of which must be found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Finds all maximal cliques in a graph using the Bron-Kerbosch algorithm. The input graph here is | |
# in the adjacency list format, a dict with vertexes as keys and lists of their neighbors as values. | |
# https://en.wikipedia.org/wiki/Bron-Kerbosch_algorithm | |
from collections import defaultdict | |
def find_cliques(graph): | |
p = set(graph.keys()) | |
r = set() | |
x = set() |