{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Simple and Hyper Graphs" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "*Stochastic Matchings* allows to build arbitrary models from their graph adjacency or incidence matrix, but also to directly instantiate some families. This tutorial gives a tour of these families and details the graph behavior of a *Model* instance." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First, we load the package." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2022-01-24T14:53:17.811008Z", "start_time": "2022-01-24T14:53:16.373336Z" }, "execution": { "iopub.execute_input": "2025-09-27T08:33:25.203097Z", "iopub.status.busy": "2025-09-27T08:33:25.202096Z", "iopub.status.idle": "2025-09-27T08:33:26.409665Z", "shell.execute_reply": "2025-09-27T08:33:26.409665Z", "shell.execute_reply.started": "2025-09-27T08:33:25.203097Z" } }, "outputs": [], "source": [ "import stochastic_matching as sm" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Simple graph: manual definition and basic usage" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A simple graph can be defined by providing its adjacency or incidence matrix. We give a tour of the possibilities using the diamond graph as running example." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2022-01-24T14:53:17.857431Z", "start_time": "2022-01-24T14:53:17.813021Z" }, "execution": { "iopub.execute_input": "2025-09-27T08:33:26.410901Z", "iopub.status.busy": "2025-09-27T08:33:26.409665Z", "iopub.status.idle": "2025-09-27T08:33:26.415934Z", "shell.execute_reply": "2025-09-27T08:33:26.415934Z", "shell.execute_reply.started": "2025-09-27T08:33:26.410901Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "