S
S
skomoroh2012-02-11 06:48:42
Python
skomoroh, 2012-02-11 06:48:42

tell me the base for graphs with weights

the next task

is a point and there are many connections with other points,
there are statistics on the number of point-to-point connections,

you need to choose one connection from a point to another point, randomly, but the distribution should depend on the weight of the connection,
that is, if according to statistics 1 connection - in 100 cases, and 2 - 1 case, then the 1st connection should be selected about 100 times more often

done on sql, but I want something faster

, preferably with libraries under python

thanks

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Sergey, 2012-02-11
@bondbig

KPZ "Count with weights"
image
I. Repin, oil on canvas.

V
Vidog, 2012-02-11
@Vidog

postgresql supports scripting languages, perl, python, php, etc. in general, you can perform intermediate calculations on mongo - there is a good mapReduce

S
skomoroh, 2012-02-11
@skomoroh

on postgres and made
no intermediate calculations, everything has already been calculated, you just need to choose
looking for a ready-made specialized solution

S
Sergey Sokolov, 2013-02-28
@sergiks

look at neo4j

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question