Commit 3383c37f authored by felixk1990's avatar felixk1990
Browse files

fixing transition bugs

parent af59671e
......@@ -8,16 +8,17 @@
import networkx as nx
import numpy as np
import sys
import simple_cycle_tools
import cycle_tools_simple
class coalescence(cycle_tools_simple.simple,object):
def __init__(self):
super(cycle_coalescence,self).__init__()
super(coalescence,self).__init__()
def calc_cycle_asymmetry(self,input_graph):
minimum_basis=self.construct_minimum_basis(input_graph)
minimum_basis=self.construct_networkx_basis(input_graph)
cycle_tree=self.calc_cycle_coalescence(input_graph,minimum_basis)
tree_asymmetry=self.calc_tree_asymmetry(cycle_tree)
......
......@@ -186,12 +186,12 @@ class simple(cycle_tools.toolbox,object):
idx_nz=np.nonzero(E[column:,column])[0]
idx=idx_nz[0]+column
if len(idx_nz)==1
if len(idx_nz)==1:
E[[column,idx_nz[0]+column],:]=E[[idx_nz[0]+column,column],:]
else:
new_idx=idx_nz[1:]+colum
new_idx=idx_nz[1:]+column
aux_E=np.add(E[new_idx],E[idx])
E[new_idx]=np.mod(aux_E,2)
E[[column,idx_nz[0]+column],:]=E[[idx_nz[0]+column,column],:]
......
......@@ -6,23 +6,35 @@
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEGCAYAAABo25JHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/d3fzzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAcuElEQVR4nO3df5RUZ53n8ffHDhnboGEy0V7TMMI4DBnG/MC0oOJqo0aIPwZ04jExxjGa5WRHorMqI4xndOY454jL6Bo1yvYxmHFnxnZHsQcTNm2OWPG3AgJpIWllURMKN/EXxI6tAfzuH1VN3yqquy9N37pN3c/rnD6pe+/zVH37m6K/dZ+n7n0UEZiZWXE9Lu8AzMwsXy4EZmYF50JgZlZwLgRmZgXnQmBmVnDn5B3A6brwwgtj7ty5k+r76KOPct55501tQGcx56OW8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background": "light"
},
"output_type": "display_data"
"name": "stdout",
"output_type": "stream",
"text": [
"[<networkx.classes.graph.Graph object at 0x1114e8f60>, <networkx.classes.graph.Graph object at 0x1114ec438>, <networkx.classes.graph.Graph object at 0xa24a82a58>, <networkx.classes.graph.Graph object at 0xa24a82630>, <networkx.classes.graph.Graph object at 0xa24a827b8>, <networkx.classes.graph.Graph object at 0xa24a825f8>, <networkx.classes.graph.Graph object at 0xa24a82588>, <networkx.classes.graph.Graph object at 0xa24a82780>, <networkx.classes.graph.Graph object at 0xa24a82940>, <networkx.classes.graph.Graph object at 0xa24a82748>, <networkx.classes.graph.Graph object at 0xa24a826d8>, <networkx.classes.graph.Graph object at 0xa24a82668>, <networkx.classes.graph.Graph object at 0xa24a82978>, <networkx.classes.graph.Graph object at 0xa24a829b0>, <networkx.classes.graph.Graph object at 0xa24a82908>, <networkx.classes.graph.Graph object at 0xa24a82898>, <networkx.classes.graph.Graph object at 0xa24a82828>, <networkx.classes.graph.Graph object at 0xa24a827f0>, <networkx.classes.graph.Graph object at 0xa24a828d0>, <networkx.classes.graph.Graph object at 0xa24a829e8>, <networkx.classes.graph.Graph object at 0xa24a82860>, <networkx.classes.graph.Graph object at 0xa24a82a20>, <networkx.classes.graph.Graph object at 0xa24a826a0>, <networkx.classes.graph.Graph object at 0xa24a82a90>, <networkx.classes.graph.Graph object at 0xa24a82ac8>, <networkx.classes.graph.Graph object at 0xa24a82b00>, <networkx.classes.graph.Graph object at 0xa24a82b38>, <networkx.classes.graph.Graph object at 0xa24a82b70>, <networkx.classes.graph.Graph object at 0xa24a82ba8>, <networkx.classes.graph.Graph object at 0xa24a82be0>, <networkx.classes.graph.Graph object at 0xa24a82c18>, <networkx.classes.graph.Graph object at 0xa24a82c50>, <networkx.classes.graph.Graph object at 0xa24a82c88>, <networkx.classes.graph.Graph object at 0xa24a82cc0>, <networkx.classes.graph.Graph object at 0xa24a82cf8>, <networkx.classes.graph.Graph object at 0xa24a82d30>]\n"
]
},
{
"ename": "TypeError",
"evalue": "__call__() got an unexpected keyword argument 'keys'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-3-ba13ee564711>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 20\u001b[0m \u001b[0mminimum_basis\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mT\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconstruct_networkx_basis\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mG\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 21\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mminimum_basis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 22\u001b[0;31m \u001b[0mcycle_tree\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mT\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcalc_cycle_coalescence\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mG\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mminimum_basis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 23\u001b[0m \u001b[0mdict_asymmetry\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mT\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcalc_tree_asymmetry\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcycle_tree\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/Documents/GitHub/cycle-coalescence-algorithm/cycle_analysis/cycle_tools_coalescence.py\u001b[0m in \u001b[0;36mcalc_cycle_coalescence\u001b[0;34m(self, input_graph, cycle_basis)\u001b[0m\n\u001b[1;32m 31\u001b[0m \u001b[0mcycle_tree\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mnx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGraph\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 32\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mcycle\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcycle_basis\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 33\u001b[0;31m \u001b[0mcycle_tree\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madd_node\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtuple\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcycle\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0medges\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mlabel\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'base'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mweight\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m1.\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mbranch_type\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'none'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mpos\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 34\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 35\u001b[0m \u001b[0;31m# get the weights of the input graph and sort\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mTypeError\u001b[0m: __call__() got an unexpected keyword argument 'keys'"
]
}
],
"source": [
"import sys\n",
"sys.path.insert(0, \"../cycle_analysis\")\n",
"import cycle_tools_coalescence as ctc\n",
"import test as cat\n",
"import networkx as nx\n",
"import matplotlib.pyplot as plt\n",
"import cycle_analysis.cycle_coalescence as cc\n",
"import cycle_analysis.test as cat\n",
"# import cycle_analysis.cycle_tools_coalescence as ctc\n",
"# import cycle_analysis.test as cat\n",
"\n",
"# generate a dummy graph for testing\n",
"# put an edge weight distribution on the system, available are random/gradient/bigradient/nested_square\n",
"G=nx.grid_graph((7,7,1))\n",
......@@ -32,9 +44,11 @@
"pos=nx.get_node_attributes(G,'pos')\n",
"\n",
"# merge all shortest cycles and create merging tree, then calc asymmetry of the tree's branches\n",
"minimum_basis=cc.construct_minimum_basis(G)\n",
"cycle_tree=cc.calc_cycle_coalescence(G,minimum_basis)\n",
"dict_asymmetry=cc.calc_tree_asymmetry(cycle_tree)\n",
"T=ctc.coalescence()\n",
"minimum_basis=T.construct_networkx_basis(G)\n",
"print(minimum_basis)\n",
"cycle_tree=T.calc_cycle_coalescence(G,minimum_basis)\n",
"dict_asymmetry=T.calc_tree_asymmetry(cycle_tree)\n",
"\n",
"# plot branching asymmetry in dependence of branching level\n",
"x,y=[],[]\n",
......@@ -48,6 +62,13 @@
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment