What weights represent in Jaegar dependencies DAG view? - trace

I'm unable to find what these edge weights(red circle) represent inside my DAG view.
Any of you know what they try to represent?

It represents the number of requests made from one service to other.

Related

Remove self loops and multiple edges from configuration multigraph

I am trying to draw a random network with a real sequence of degrees, using configuration model.
As I understood, the function returns a multigraph with self-loops and multiple edges.
How can I remove all self-loops and change all multiple edges for one simple edge?
I would appreciate any help!

Creation of two networks with the same node coordinates

I create a network add nodes and edges. I view it (it creates a dot and pdf file automatically). Later, I want to create a second network with the same nodes but different edges. I want to place the nodes in the same coordinates, so that I can make a comparison of both graphs easily. I tried to get the coordinates of the first graph, and tried to set the coordinates of the nodes) but I couldn't find proper functions to do that. I also checked networkx package. I also tried to get a copy of the first network, and delete the edges with no success. Can someone please show me how to create a second network with the same node coordinates?
This is the simple network creation code
import graphviz as G
network1 = G.Digraph(
graph_attr={...},
node_attr={...},
edge_attr={...} )
network.node("xxx")
network.node("yyy")
network.node("zzz")
network.edge("xxx", "yyy")
network.edge("yyy", "zzz")
network1.view(file_name)
First, calculate the node positions for the first graph using the layout of your choice (say, the spring layout):
node_positions = nx.layout.spring_layout(G1)
Now, you can draw this graph and any other graph with the same nodes in the same positions:
nx.draw(G1, with_labels=True, pos=node_positions)
nx.draw(G2, with_labels=True, pos=node_positions)
Graphviz's layers feature might also be interesting:
https://graphviz.org/faq/#FaqOverlays
Here is a working example of using layers - ignore the last two lines that create a video.
https://forum.graphviz.org/t/stupid-dot-tricks-2-making-a-video/109
And here is some more background:
https://forum.graphviz.org/t/getting-layers-to-work-with-svg/107

Choosing a networkx layout that takes edge labels into account

I'm plotting networkx weighted graphs using the draw_networkx_edge_labels function. My problem is that, since edges sometimes cross each other, it is not always clear from the plot which weight belongs to which edge. For instance, in the following plot it is not immediately clear whether 2 is the weight of (1,2) or (3,7).
I'm currently using the neato layout, which does not take edge labels into account. In particular, this is how I'm drawing a weighted graph g:
layout = nx.nx_pydot.graphviz_layout(g, prog='neato')
nx.draw(g, pos=layout)
edge_labels = nx.get_edge_attributes(g, 'weight')
nx.draw_networkx_edge_labels(g, pos=layout, edge_labels=edge_labels)
I know I can manually control the position of the label along an edge using the label_pos parameter, but my question is whether there exists a way to automatically plot the graph such that edge labels do not usually collide (either using a layout that takes labels into account or a method that "neatly" selects label positions along edges).
I'm not expecting something that always works, but since my graphs are relatively sparsely connected, I hope there's a method that at least has a tendency to work well.
I have been meaning to implement this in netgraph, my fork of the networkx drawing utilities, for a while now. Unfortunately, I have a job interview on Thursday, so I won't have time to write this anytime soon. The basic idea, however, is pretty simple, and is also already implemented in some R packages such as ggrepel and also ggnetwork.
The basic idea is that you use a force directed layout to position your labels, given a predetermined and fixed layout for your nodes and edges. So:
Compute a node layout using the layout of your choice.
Partition each edge into a chain of many, many nodes, and compute the positions of the "edge nodes" using the already known positions of the source and target nodes of the edge. This partitioning is to give each edge a "mass" in the following force directed layout.
For each edge, add a "label" node and connect it to the most central "edge node".
Compute a force-directed layout keeping all nodes but the label nodes fixed (e.g. using spring_layout in networkx).
You should now have sensible edge label coordinates that do not overlap any of the edges. Use plt.annotate to plot a connection between the edge and the edge label.

split one object to two ones

I have a task which I should split a connected object into two split ones.
on right image, at the bottom right of the image the two objects has connectivity which I should cut this side. I need to have two objects for my further processes.
final task is to find the slope of inner surface as in the first picture
you can see the image:
i want to have something right left this.
if you assume the object is thiner at the junction, you can apply morphological opening (using the imopen function, you need image processing toolbox). On your example this sould work, but it depends on the other cases you need to process.

DBSCAN clustering - what happens when border point of one cluster is considered to be core point of another cluster

I would like to know your opinion about dbscan clustering, I am trying to implement algorithm as published here. In my opinion there is possibility for one point from border of some cluster to be an core point of another one as shown in picture:
.
I think there are some of the possible solutions:
we could consider point as written to cluster and that cannot be changed - but we could lost second cluster because of that
we could be able to change border points cluster but without recomputing epsilon neighbourhood.
we could be able to add point into multiple clusters (worst one).
What do you think is the best? Or am I getting something completely wrong?
The core-point property is not cluster specific.
Either the point is a core point, or it is not; independent of which cluster it is in.
If it is a core point, then it cannot be a noise or border point anymore.
Whenever two core points are neighbors, they by definition are in the same cluster.
The known special case that can happen is that one point is border to more than one cluster. See end of page 229.