Skip to content

Instantly share code, notes, and snippets.

@mzsima
mzsima / readme.md
Last active May 30, 2020 15:15
ひらがな、あ行

image

snapshot

code gremlin

hiragana = "あいうえおかきくけこさしすせそたちつてとなにぬねの"


schema.vertexLabel("Letter").ifNotExists().partitionBy("id", Text).create();
schema.edgeLabel('row').ifNotExists().from('Letter').to('Letter').create()

image

snapshot

code jupyternotebook networkx

import matplotlib.pyplot as plt
import networkx as nx

G = nx.cycle_graph(24)
pos = nx.spring_layout(G, iterations=200)
@mzsima
mzsima / readme.md
Created May 27, 2020 16:13
linked list

image

snapshot

code gremlin

schema.vertexLabel("Node").ifNotExists().partitionBy("id", Text).property("value", Text).create();
schema.edgeLabel('next').ifNotExists().from('Node').to('Node').create()
schema.edgeLabel('prev').ifNotExists().from('Node').to('Node').create()
  
 
@mzsima
mzsima / readme.md
Last active May 26, 2020 14:42
1+2のRPN

image

snapshot

code gremlin

schema.vertexLabel("Op").ifNotExists().partitionBy("id", Text).property("value", Text).create();
schema.edgeLabel('next').ifNotExists().from('Op').to('Op').create()
  
  
N1 = g.addV("Op").property("id", "a").property("value", "1").next();
@mzsima
mzsima / readme.md
Last active May 25, 2020 14:59
環状木

image

snapshot

code jupyter notebook

import matplotlib.pyplot as plt
import networkx as nx

try:
 import pygraphviz
@mzsima
mzsima / readme.md
Created May 24, 2020 15:19
[networkX]グリッドeven/odd

image

snapshot

code jupyter notebook

import matplotlib.pyplot as plt
import networkx as nx

G = nx.grid_2d_graph(5, 5) 
pos = nx.spring_layout(G, k=0.3)
@mzsima
mzsima / readme.md
Created May 23, 2020 15:15
5x5 grid

image

snapshot

code jupyter notebook

import matplotlib.pyplot as plt
import networkx as nx

G = nx.grid_2d_graph(5, 5) 
nx.draw(G)
@mzsima
mzsima / readme.md
Last active May 22, 2020 14:01
[networkX] ただの三角

image

snapshot

code jupyter notebook

%matplotlib inline
import matplotlib.pyplot as plt
import networkx as nx
G = nx.Graph()
@mzsima
mzsima / readme.md
Last active May 21, 2020 15:01
CO2

image

snapshot

code gremlin

schema.vertexLabel("Atom").ifNotExists().partitionBy("id", Text).property("name", Text).create();
schema.edgeLabel('bond').ifNotExists().from('Atom').to('Atom').create()
  
  
O1 = g.addV("Atom").property("id", "O1").property("name", "O").next();
@mzsima
mzsima / readme.md
Last active May 20, 2020 16:47
Cのコードはドミソ

image

snapshot

code gremlin

schema.vertexLabel("Key").ifNotExists().partitionBy("name", Text).create();
schema.vertexLabel("Code").ifNotExists().partitionBy("name", Text).create();
schema.edgeLabel('hit').ifNotExists().from('Code').to('Key').create()