co.combinatorics – Are contraction-sensitive graphs necessarily green-transitive?

We say that a graph is finite, simple, undirected $ G = (V, E) $ is sensitive to contraction if everything collapses $ 2 $ non-adjacent points increase the Hadwiger number. The icosahedron is an example of a graph.

Are all contraction-sensitive graphs green-transitive?

python – Is it possible to easily edit / create a custom dispersion marker for bokeh graphs?

I am relatively new to python and bokeh. What I'm trying to do is use the scatter plot to show wind speed and direction. I wanted to use the triangle marker and use the rotation to indicate the wind speed. However, since the default bokeh triangle is an equilateral triangle, the direction of the wind is confusing (you can not know which head corresponds to the tail).

Is there a way to change / create my own triangle which is Isosceles instead? it's so that i can tell which head is the tail in the triangle.

Thank you!

graphs – Prove that the total distance is minimized (on the longest trip)

Here is the problem: given a tree $ T $I have to visit each node of the tree once. I can start and finish where I want.

As my specifications are not really clear, I suggest an example: consider the graph (which is a tree – non-oriented weighted acyclic graph) to have nodes as cities and edges as routes between cities. I have to deliver something in each city (visit each node at least once). I can leave any city and finish in the city of my choice.

I read the following result. Find the two most distant cities in the graph (call them $ c1 $ and $ c2 $). Start with one of them ($ c1 $ or $ c2 $), visit all other cities until you reach ($ c2 $ or $ c1 $). This minimizes the total distance to travel.

How should I prove that it is the minimum distance?

I tried the next one. I have the last route and I call the edges, $ m_1, m_2, …, m_i $ and $ e_1, e_2, …, e_j $. Or $ m_1, m_2, …, m_i $ boundaries of the most distant cities ($ c1 $ and $ c2 $) and $ e_1, e_2, …, e_j $ are all the rest in the graph. As I leave $ c1 $, I travel along the edges labeled m once and all the rest is a digression and come and go twice on these edges before reaching $ c2 $.

We know that $ m_1, m_2, …, m_i $ and $ e_1, e_2, …, e_j $ taken together, they include all the edges of the graph (as it is a tree, there is only one path between two nodes). So, the distance I was traveling could be given as $ 2 (e_1 + e_2 + …. + e_j) + (m_1 + m_2 + … + m_i) $.

I have to prove that this sum is lower than all the other roads I can take to reach all the cities. My intuition says that it must be the shortest route. I think I have to use the fact that $ (m_1 + m_2 + … + m_i) $ is the maximum between two nodes in the graph (does this call the diameter?) and leads to a contradiction.

This is the kind of image I have in mind (the red edges are in ($ m_1, m_2, …, m_i $) and the gray ones are all the rest),

enter the description of the image here

This graphic is always a tree (please ignore the point of the arrow in the edges that indicates how I decide to travel). I do not know where to go from here. I would appreciate a proof that is simple to understand (this is not a duty or anything related to the courses.)

graphs – Correction of the algorithm and its complexity

I'm trying to solve the problem of generating a network graph said activity-on-board (activity over arc) given on the basis of a network activity graph on given node.

I have therefore found in this article an algorithm solving the problem, but I do not really understand the example given on pages 5-6, namely the partition of the graph in complete bipartite subgraph presented on the page. 6. I do not see any difference between Figures 11b and 11c – it seems that they must differ.

Could anyone explain how the authors came to the solution and is that correct?

Quote from paper: Mouhoub, Nasser and Benhocine, Abdelhamid. (2012). An efficient algorithm for generating AoA networks. International Journal of Computer Problems. 9

Direct link to pdf: link.

graphs – An efficient algorithm for eliminating redundant nodes in a DAG

I have a table that stores program instructions. It has 5 columns:

  • id_node: A unique identifier
  • nm_instruction: Name of the function (which only returns one output)
  • ls_args: List of arguments for the function call (may include hard-coded parameters or the outputs of other nodes)
  • ls_parent_ids: List of parent instructions (that is, nodes that are inputs for the function call)
  • ls_child_ids: List of dependent statements (that is, nodes that use the output of this node)

There are no cycles, so it's a DAG. There may be redundant instructions (ie equivalent parents and equal hard-coded parameters), so I want to optimize this DAG.

Here is my naive approach:

  1. Topological type
  2. Pop top node and add it to the final optimized table
  3. Among the remaining nodes, look for those that are redundant with the node jumped (that is, even nm_instruction / ls_args / ls_parent_ids).
  4. Remove redundant nodes
  5. Replace the redundant node IDs with the deleted node ID, where they appear
  6. Go to 2 as long as the original table is not empty

What is the name of this problem? What's an effective algorithm for solving it?

Thank you!

The Sankey graphs are empty when they are saved as SVG with the help of plotly for python

as the title says, every time I save a Sankey graph, big or small, it always produces a blank svg. Is there a way to solve this problem? The graph is normally displayed in my jupyter notebook but saves a blank svg (only the title is visible).

I'm using plotly 3.6.1

I've already asked the same question to the Plutly community council, but there was no answer.

def drawSankeyForAreaFlow (area_flow_data, log_index):
sankeyData = getSankeyData (area_flow_data)

data = dict (
type = & # 39; sankey & # 39;
node = dict (
pad = 30,
line = dict (
width = 0.5
)
label = ['label 1', 'label 2', 'label 3', 'label 4', 'label 5', 'label 6', 'label 7', 'label 8', 'label 9', 'label 10', 'label 11', 'label 12', 'label 13', 'label 14', 'label 15', 'label 16'],
color = ['#FF40C5', '#FF4A80', '#FF713D', '#FF9600', '#E5B200', '#A4C700', '#47D400', '#00DB65', '#00DFAE', '#00E1F5', '#00DEFF', '#00D6FF', '#00C7FF', '#58AEFF', '#EA8BFF', '#FF61FF', '#FF40C5']
    )
link = dict (
source = [0, 2, 2, 2, 2, 2, 3, 4, 4, 4, 5, 8, 8, 9, 11, 12, 12, 14, 14, 15, 15, 15, 15, 15],
target = [2, 4, 5, 11, 12, 15, 9, 4, 12, 15, 2, 2, 4, 0, 3, 0, 2, 8, 14, 0, 4, 12, 14, 15],
value = [6, 2, 1, 1, 2, 2, 1, 1, 1, 5, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 3, 2, 1, 6]
))

layout = dict (
title = "Sankey for log" + str (log_index),
font = dict (
size = 10
)
)

fig = go.Figure (data =[data], layout = layout)
pio.write_image (fig, "./output/graphs/" + "Sankey for log" + str (log_index) + ".svg")
plotly.offline.iplot (fig, validate = False)

returns {& # 39; sources :: sankeyData[‘sources’], & # 39; targets & # 39 ;: sankeyData[‘targets’], & # 39; values ​​& # 39 ;: sankeyData[‘values’]}

allSankeyData = []

for i, log enumerate (logs):
allSankeyData.append (drawSankeyForAreaFlow (log["properties"]["area_flow"], I))

graphs – How to perform machine learning on plots?

I need a machine learning code that deals with two classes of parcels and learns to re-identify which parcel belongs to which class (folder).
there are two classes (two folders with pictures). I want the code to be able to learn where each parcel belongs.

An example of what the plot looks like:
enter the description of the image here

link for the two image files:
https://drive.google.com/drive/folders/1KT6wTrMiYg200MLsH2-kouYNoT8fpB_5?usp=sharing
(Note: I am looking for an example or a step at a time, I am still a novice in machine learning but I have not found sample code on the parcels)

All the shortest paths from top to top s at the top t: for graphs with positive weights

The code to search for all the shortest paths from top to bottom is provided in[BreadthFirstScan][1]. The relevant parts are under Applications, then Applications the shortest path, and in this section: the second example (for unweighted graphs). Is there online information for which an adaptation is given for graphics with edge weights (positive weights)? The code for the unweighted case is copied below.

Find all the shortest paths in an unweighted chart, with an example of a grid chart:

s = 1; t = 3 * 4;
g = GridGraph[{3, 4}, VertexSize -> {s -> Medium, t -> Medium}]

découvrirFun[u_, v_, d_] : = Si[u != v,  PropertyValue[{g, u},      
"ShortestPaths"] = Table[Append[p, u], {p, PropertyValue[{g, v}, 
"ShortestPaths"]}]; Value of the property[{g, u}, "Distance"] = d]revisiterFun[u_, v_] : = Si[Valeurdelapropriété[PropertyValue[Valeurdelapropriété[PropertyValue[{g, u}, "Distance"] ==
Value of the property[{g, v}, "Distance"] + 1, PropertyValue[{g, u}, 
"ShortestPaths"] = Join[PropertyValue[{g, u}, "ShortestPaths"],
Table[Append[p, u], {p, PropertyValue[{g, v}, "ShortestPaths"]}]]]Value of the property[{g, s}, "ShortestPaths"] = {{s}};
Value of the property[{g, s}, "Distance"] = 0;

LargeurAvantScan[g,  s, {"DiscoverVertex" -> discoverFun, 
"VisitedVertex" -> revisitFun,  "UnvisitedVertex" -> revisitFun}];

Table[HighlightGraph[g, p], {p, PathGraph / @ PropertyValue[{g, t}, 
"ShortestPaths"]}]

graphs and networks – All the shortest paths: argument 1 is not a valid vertex error

I run the following code to generate all the shortest paths:

g = graph[{"a" -> "b", "b" -> "c", "d" -> "b"}];

GraphPlot[g, VertexLabeling -> True]

s = VertexIndex[g, "a"]
t = VertexIndex[g, "c"]

Value of the property[{g, s}, "ShortestPaths"] = {{s}};
Value of the property[{g, s}, "Distance"] = 0;

découvrirFun[u_, v_, d_] : =
Yes[u != v, 
 PropertyValue[{g, u}, "ShortestPaths"] =
Table[Append[p, u], {p, PropertyValue[{g, v}, "ShortestPaths"]}];
Value of the property[{g, u}, "Distance"] = d]redécouvrirFun[u_, v_] : =
Yes[Valeurdelapropriété[PropertyValue[Valeurdelapropriété[PropertyValue[{g, u}, "Distance"] ==
Value of the property[{g, v}, "Distance"] +1
Value of the property[{g, u}, "ShortestPaths"] =
Join[Valeurdelapropriété[PropertyValue[Valeurdelapropriété[PropertyValue[{g, u}, "ShortestPaths"],
Table[Append[p, u], {p, PropertyValue[{g, v}, "ShortestPaths"]}]]]LargeurAvantScan[g, 
  s, {"DiscoverVertex" -> discoverFun, 
  "VisitedVertex" -> rediscoverFun, 
  "UnvisitedVertex" -> rediscoverFun}];

This produces the following error: BreadthFirstScan :: inv: argument 1 in BreadthFirstScan[Graphic[[Graph[[Graphique[[Graph[<4>, <3>], 1, {DiscoverVertex -> discoverFun, VisitedVertex -> <<12>> n, UnvisitedVertex -> rediscoverFun}]is not a valid vertex.

BreadthFirstScan is not it designed to run on top indexes?

graphs and networks – Harvest and Sowing for BreadthFirstSearch

The following code highlights the first width scan tree

g = GridGraph[{3, 5}, VertexSize -> {5 -> Medium}]
Collect[BreadthFirstScan[g, 5, {"FrontierEdge" -> Sow}]]

This produces the output (where <-> represents the non-directed edge).

{{2, 5, 2, 5, 5, 5, 4, 5, 6, 7, 8, 9, 10, 11,
12}, {{5 <-> 2, 5 <-> 4, 5 <-> 6, 5 <-> 8, 2 <-> 1, 2 <-> 3, 4 <-> 7, 6 <-> 9, 8 <-> 11, 7 <-> 10, 9 <-> 12, 11 <-> 14, 10 <-> 13, 12 <-> 15}}}

I read about reaping and sowing and understanding the second list. The first list that is supposed to capture the final result of the compound expression is however not clear.

What do the vertices of this first list represent (in the context of harvesting and sowing for this particular application)?

{2, 5, 2, 5, 5, 5, 4, 5, 6, 7, 8, 9, 10, 11, 12}

In a first thorough analysis, I expected the final results to be more closely related to the order of the nodes visiting the analysis.

Is this output compatible with what should be produced in a harvest and sow context for this particular application? And if so, can you specify how this happens (in terms of harvesting and operating sows)?