File:Planted clique 18,64.svg
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this PNG preview of this SVG file: 600 × 600 pixels. Other resolutions: 240 × 240 pixels | 480 × 480 pixels | 768 × 768 pixels | 1,024 × 1,024 pixels | 2,048 × 2,048 pixels | 1,536 × 1,536 pixels.
Original file (SVG file, nominally 1,536 × 1,536 pixels, file size: 30 KB)
File information
Structured data
Captions
Summary
[edit]DescriptionPlanted clique 18,64.svg |
English: An 18-vertex planted clique (blue vertices and upper edges) in a 64-vertex random graph (all vertices and lower edges). Every pair of blue vertices is adjacent; the remaining pairs are adjacent randomly with probability 1/2. |
Date | |
Source | Own work |
Author | David Eppstein |
Licensing
[edit]I, the copyright holder of this work, hereby publish it under the following license:
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.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
Source code
[edit]from PADS import SVG
import sys
import random
n = 64
k = 18
r = 6
w = 4*n*r
def vertex(i):
return 4*i*r + 2*r + (w//2)*1j
def radius(i,j):
return 2*abs(i-j)*r
planted = set()
while len(planted) < k:
planted.add(random.randrange(n))
svg = SVG.SVG(w+w*1j,sys.stdout)
svg.group(stroke=SVG.colors.black)
svg.group(fill=SVG.colors.none)
for i in range(n):
for j in range(i):
if i in planted and j in planted:
svg.arc(vertex(i),vertex(j),radius(i,j))
elif random.randrange(2):
svg.arc(vertex(j),vertex(i),radius(i,j))
svg.ungroup()
svg.group(fill=SVG.colors.blue)
for i in range(n):
if i in planted:
svg.circle(vertex(i),r)
svg.ungroup()
svg.group(fill=SVG.colors.yellow)
for i in range(n):
if i not in planted:
svg.circle(vertex(i),r)
svg.ungroup()
svg.ungroup()
svg.close()
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 08:10, 17 November 2023 | 1,536 × 1,536 (30 KB) | David Eppstein (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
The following page uses this file:
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 1536 |
---|---|
Height | 1536 |
Hidden categories: