File:Bunkbed counterexample for hypergraphs.svg

From testwiki
Jump to navigation Jump to search
    Original file (SVG file, nominally 461 × 461 pixels, file size: 22 KB)

    This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

    Summary

    Description
    English: Counterexample to the bunkbed counterexample for hypergraphs, as first constructed by Lawrence Hollom (2024) in arxiv:2406.01790. If all the indicated horizontal hyperedges (yellow) and vertical posts (dark gray) are selected independently with probability 1/2, the vertices 1 (red) and 10' (cyan) are slightly more likely to be connected than 1 and 10.
    Date
    Source Own work
    Author LaundryPizza03
    SVG development
    InfoField
     The SVG code is valid.
     This plot was created with Matplotlib.
    Source code
    InfoField

    Python code

    Source code
    import numpy as np
    import matplotlib as mpl
    from matplotlib import pyplot as plt
    import mpl_toolkits.mplot3d.art3d as art3d
    
    # Hypergraph properties and embedding
    VERTS = np.array([(0,0),(1,-2),(1,2),(2,-2),(2,-2/3),(2,2/3),(3,0),(4,-2),(3,2),(5,0)])
    Nv = len(VERTS)
    X = 0; Y = 9; POSTS = np.array([1,6,8])
    EDGES = np.array([(0,1,2),(1,3,4),(2,5,8),(3,6,7),(4,5,6),(7,8,9)])
    Ne = len(EDGES)
    BUNK_OFFSET = np.array([0,-1])
    
    fig = plt.figure(layout='constrained',figsize=[4.8, 4.8],frameon=False)
    ax = fig.add_subplot(projection='3d',computed_zorder=False)
    ax.set_box_aspect((7,4,4))
    ax.view_init(30,-75)
    ax.set_proj_type('ortho')
    ax.set_axis_off()
    
    # Plot vertices
    vcolors = np.full((Nv,3),0.95)
    vcolors[POSTS] = np.full((len(POSTS),3),0.75)
    vcolors[X] = (1,0.8,0.8)
    vcolors[Y] = (0.6,1,1)
    for v in range(Nv):
        ax.plot(*VERTS[v],zs=BUNK_OFFSET[0],ls='',c=(0.75,0.75,0.75),marker='o',mfc=vcolors[v],mec='black',ms=20,zorder=2+BUNK_OFFSET[0]/100)
        ax.plot(*VERTS[v],zs=BUNK_OFFSET[1],ls='',c=(0.75,0.75,0.75),marker='o',mfc=vcolors[v],mec='black',ms=20,zorder=2+BUNK_OFFSET[1]/100)
        ax.plot(*np.transpose([VERTS[v]]*2),zs=BUNK_OFFSET,ls='-' if v in POSTS else '',c=(0.75,0.75,0.75),marker='o',mfc=vcolors[v],mec='black',ms=20,zorder=2+np.average(BUNK_OFFSET)/100)
        ax.text(*VERTS[v],BUNK_OFFSET[0],f'{v+1}',ha='center',va='center_baseline',size=12)
        ax.text(*VERTS[v],BUNK_OFFSET[1],f'{v+1}\'',ha='center',va='center_baseline',size=12)
    for e in range(Ne):
        for i in range(2):
            p = mpl.patches.Polygon(VERTS[EDGES[e]],alpha=0.2,fc=(1,0.75,0),ec=(0.5,0.375,0),ls=':',zorder=2+(BUNK_OFFSET[i]-0.1)/100)
            ax.add_patch(p)
            art3d.pathpatch_2d_to_3d(p,z=BUNK_OFFSET[i])
    plt.show()
    fig.savefig('bunkbed_counterexample.svg')
    

    Licensing

    I, the copyright holder of this work, hereby publish it under the following license:
    Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
    The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

    Captions

    Counterexample to the bunkbed counterexample for hypergraphs

    Items portrayed in this file

    depicts

    25 August 2026

    image/svg+xml

    File history

    Click on a date/time to view the file as it appeared at that time.

    Date/TimeThumbnailDimensionsUserComment
    current00:00, 26 August 2026Thumbnail for version as of 00:00, 26 August 2026461 × 461 (22 KB)wikimediacommons>LaundryPizza03Uploaded own work with UploadWizard

    There are no pages that use this file.