draw method#

Se verifica su funcionamiento para todas todas todas las graficas. Plottear no tarda nada, ver unit disk Time: 0.35030198097229004s

import proximitygraphs as pg
import time
uniform_sphere = pg.SetPoints.uniform_sphere(n=1000, seed=0)
uniform_sphere.draw()
(<Figure size 600x600 with 1 Axes>, <Axes: title={'center': 'SetPoints'}>)
../_images/fcc3556beda43ba1d94ee173db40c00ed374947a6e2d16ca138edf404365dc7a.png

\(\gamma\)-graph#

start = time.time()
H = pg.Gamma_Graph(uniform_sphere, gamma0=0.5, gamma1=0.5, closed=True, block_size=128)
H.draw(details=True)
end = time.time()

print(f"Time: {end - start}s")
Time: 0.08372664451599121s
../_images/7f5eb39ff746a9633dd31823b3a4c0d515bc45f3233ae2f94e865b8b83c79cd2.png
start = time.time()
H = pg.Gamma_Graph(uniform_sphere, gamma0=-0.1, gamma1=-0.1)
H.draw(details=True)
end = time.time()

print(f"Time: {end - start}s")
Time: 21.22017002105713s
../_images/48d08efb832327767a89c72445ffb2b2a0519c3fa092d8365f569a7f3d3f3127.png

Delaunay Triangulation#

start = time.time()
H = pg.DelaunayG(uniform_sphere)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.08202934265136719s
../_images/3b9a07f4fdb6cbc3e734a1617237c1a83731bdc32aef231fb36bc254ab383f0e.png

Convex Hull#

start = time.time()
H = pg.Convex_Hull(uniform_sphere)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.012156963348388672s
../_images/a53ba250961d5ef612dae4af7b2d42593fd45b41a8bd8871b7241bd053cc68b8.png

\(\alpha\)-shape#

start = time.time()
H = pg.Alpha_Shape(uniform_sphere, alpha=-5)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.02362799644470215s
../_images/52010d4814d789d67b0d05560ef47f0dc0dc6f154790716a03ec7770c4c44a6b.png

\(\alpha\)-hull#

start = time.time()
H = pg.Alpha_Hull(uniform_sphere, alpha=-5, n_points_per_arc=50)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.027238130569458008s
../_images/e83b687275feb06ed817e30799abd8a988385ce5a28b21293dd8240f6fd9db12.png

\(\beta\)-skeleton con \(\beta \in [0, \infty)\)#

start = time.time()
H = pg.Beta_Skeleton(uniform_sphere, beta=0.99, type_region='intersection')
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 27.534096717834473s
../_images/6fa61e3881ac0aca46c371b6889a2c85992b1e02e4d338af407de12c18dbe773.png
start = time.time()
H = pg.Beta_Skeleton(uniform_sphere, beta=20, type_region='lune')
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.22568082809448242s
../_images/cc59ba3b4f178e6a0e2d68f0cb2794a7e20c822c5094a8bafabfa08d47915e04.png

Gabriel Graph#

start = time.time()
H = pg.GG(uniform_sphere)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.1515514850616455s
../_images/ba317e976c89f85ae3b4bc38139a6a8beb55f9a936947ee2624377d7c97b516e.png

Relative Neighborhood Graph#

start = time.time()
H = pg.RNG(uniform_sphere)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.22647857666015625s
../_images/2c19781dac9d1968036f999f4e0028e424d229f157ed0e27ec6568aaefd3bbd9.png

MST#

start = time.time()
H = pg.MST(uniform_sphere)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.03305697441101074s
../_images/89e5043361a8389892b0281cb9121599d4916f99d4011c0ede047265de1157ce.png

Stepping Stone#

start = time.time()
H = pg.Stepping_Stone(uniform_sphere, d=3, k=3)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.2618544101715088s
../_images/733b16e8a066c06ba46a101ccd45fd74167a79d400df6ff8deb3b0fad99575c0.png

NNG#

start = time.time()
H = pg.NNG(uniform_sphere, k=2)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.025710105895996094s
../_images/11e5c8cc8cd4f55abc9b8849f51dabfb690f461757a3fc6537b5186dc92f6d1a.png

Sigma Graph#

start = time.time()
H = pg.Sigma_Graph(uniform_sphere)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 14.410646438598633s
../_images/61b6fa2fc75a1c8649a08967bdd0e294700d0b1d3b24a6467f8af7a0b78e65ca.png

Unit Disk#

start = time.time()
H = pg.Unit_Disk(uniform_sphere, dist_max=0.2)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.35030198097229004s
../_images/e39b28c315a9c1365e8b294f9828ddb15c0138d40e30dc172cb6d549495dcbc1.png

SIG#

start = time.time()
H = pg.SIG(uniform_sphere)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.28902506828308105s
../_images/a58cf9f20c01c57fbf8aaac06159fa63b80ec02f3434e11d12c9dd6b89248f9a.png

Eliptic GG#

start = time.time()
H = pg.Elliptic_GabrielG(uniform_sphere)
H.draw(details=True)
end = time.time()

print(f"Time: {end-start}s")
Time: 0.2631106376647949s
../_images/86bf2516af7c31ac6799f3f0c222911b5d869e022bef0c6789fcb2107133f30d.png

Custom kwargs#

H.draw(
    v_kwargs={"marker": "x", "zorder": 3, "s": 20, "alpha": 0.6},
    e_kwargs={"linestyle": "--"},
    fig_kwargs={"facecolor": "none"},
    title_kwargs={"loc": "left", "fontsize": 16},
)
(<Figure size 600x600 with 1 Axes>,
 <Axes: title={'left': 'Elliptic Gabriel Graph'}>)
../_images/248b77130224c2f9c2e59c0a7e290152fab95341788868170f927cdf5a247fc6.png