Skip to content

Instantly share code, notes, and snippets.

View mdmitry1's full-sized avatar
:atom:
🦁

Dmitry Messerman mdmitry1

:atom:
🦁
View GitHub Profile

General Performance Comparison

VF2 advantages

VF2 tends to perform better on graphs that are sparse (fewer connections), small, or have a regular structure (e.g., 2D meshes or bounded valence graphs with low valence). In some cases, Nauty cannot find a solution for these regular graphs if they exceed a certain size (a few dozen nodes).

Nauty advantages

Nauty (via pynauty) is generally the better algorithm for dense or large randomly connected graphs.

#!/usr/bin/python3.14
import arxiv,sh
from json import load, loads, dump, dumps, JSONDecodeError
from sys import argv
from os import makedirs, listdir, getcwd
from os.path import join, isdir, isfile, realpath, dirname
from typing import List, Tuple
from pydantic import RootModel
from operator import itemgetter
from rich import print as rprint
#!/usr/bin/python3.12
import json
import pandas as pd
# Read the JSON file
with open('funds.json', 'r', encoding='utf-8') as f:
data = json.load(f)
# Extract the result array
funds_list = data['funds']['result']
#!/usr/bin/python3.12
# coding: utf-8
# author: github.com/vuiseng9
# dependency ubt1804: graphviz libgraphviz-dev libgl1-mesa-glx
import os, sys
import pygraphviz
from glob import glob
from natsort import natsorted
from rich import print as rprint
#!/usr/bin/python3.14
"""Query GitHub API"""
from datetime import datetime
from urllib.request import urlopen
from pprint import pformat
from sys import argv
import json
from os import popen
def user_time(login):
@mdmitry1
mdmitry1 / questionary_ex.py
Last active November 9, 2025 20:34
Example of using typer
#!/usr/bin/python3.12
import questionary
from questionary import Style
from rich.console import Console
console_256=Console(color_system="256")
fancy = Style([
('qmark', 'fg:#673ab7 bold'),
('question', 'bold'),
('answer', 'fg:#ff00ff bg:#ffffff nobold'),
('pointer', 'fg:#673ab7 bold'),
@mdmitry1
mdmitry1 / Makefile
Last active October 18, 2025 08:06
Disjoint set
MODULE=disjoint_set_c
VER=12
EXT=cpython-3$(VER)-$(HOSTTYPE)-gnu.so
SO=$(MODULE).$(EXT)
%.$(EXT): %_setup.py %.pyx
env PYTHONPATH=/usr/local/lib/python3.12/dist-packages python3.$(VER) $< build_ext -i
strip $@
-rm -rf build
all: $(SO)
clean:
#!/usr/bin/python3.12
'''
https://www.pythonguis.com/tutorials/qtableview-modelviews-numpy-pandas/
'''
from sys import argv, exit
from rich import print as rprint
from pandas import read_csv
from os import name as osname, popen
from os.path import realpath, basename, splitext, split
from re import sub
@mdmitry1
mdmitry1 / Makefile
Last active December 7, 2025 13:38
Prime numbers calculation in C++, Cython an Python
MODULE=primes_cython
VER=14
EXT=cpython-3$(VER)-$(HOSTTYPE)-gnu.so
SO=$(MODULE).$(EXT)
%: %.cpp
g++ -O2 -o $@ $<
strip $@
%.$(EXT): %_setup.py %.pyx
env PYTHONPATH=/usr/local/lib/python3.14/site-packages python3.$(VER) $< build_ext -i
strip $@
#!/usr/bin/tcsh -f
"/usr/bin/true" '''\'
setenv PYTHONPATH /home/mdmitry/python3.12/dist-packages:/home/mdmitry/python3.12/dist-packages6
exec /usr/bin/python3.12 $0
'''
'''
https://octave.sourceforge.io/octave/function/sombrero.html
'''
import numpy as np
import matplotlib