Skip to content

uneven edge length scaling in networkBFEalloc #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JenkeScheen opened this issue Jul 8, 2020 · 3 comments
Closed

uneven edge length scaling in networkBFEalloc #1

JenkeScheen opened this issue Jul 8, 2020 · 3 comments

Comments

@JenkeScheen
Copy link

I'm trying to generate a diffnet in spring_layout using a 11x11 symmetrical sij with np.inf on diagonal:
sij_sym.npy.zip

%matplotlib inline
import matplotlib
from matplotlib import pyplot as plt
matplotlib.rcParams['font.size'] = 20
import networkx as nx
import numpy as np
from cvxopt import matrix
import diffnet as dn
import graph as gph
from netbfe import *

sij = matrix(np.sqrt(np.load("sij_sym.npy")))

#insert delta with stdev=1 for first s_ii:
delta = sij.shape[0] * [np.inf]
fict_delta = [1] + delta[1:]

#minimal graph generation:
n = networkBFEalloc( sij, N=1000, delta=fict_delta)
G = gph.diffnet_to_graph( n)
gph.draw_diffnet_graph( G, widthscale=1e-1, nodescale=5)

however this returns a graph where the origin node is distanced, skewing the network:
image

@forcefield
Copy link
Owner

Do you have the same problem when the diagonal elements of sij are not np.inf?

@JenkeScheen
Copy link
Author

looks like it, yes. This matrix:
image
produces a similarly skewed network with the same code:
image

@forcefield
Copy link
Owner

I pushed a new graph.py that might alleviate this problem. Please see issues/001 for the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants