javascript: shows several data with the same X and Y in the high graph

I try to use highchart in react-native to show 6 status data, and it works with the data shown. But because the 6 data have the same X and Y, then the data was shown but stacked to make it appear that there is only one data (the X is the time when the data receives the publication, and the Y the day in that the data get the send). Is there any way to make all the data appear on the graph? Thanks before

This is the picture that looks like this:

Image

This is my highchart configuration:

var conf= {
        chart: {
            type: 'scatter',
            backgroundColor: '#233767',
            zoomType: 'xy',
        },
        xAxis: {
          type: 'datetime',
          labels: {
              formatter: function () {
                return Highcharts.dateFormat('%Y-%m-%d', this.value);
              },
              style:{
                color:'white'
              }
            },
        },
        yAxis: {
           type: 'datetime',
           lineWidth: 1,
           dateTimeLabelFormats: {
             minute: '%H:%M'
           },
           labels: {
                style:{
                    color:'white'
                  }
           },
           title: {
             enabled: false
           },
           gridLineColor:'transparent'
        },
        plotOptions: {
            scatter: {
                marker: {
                    radius: 5,
                    states: {
                        hover: {
                            enabled: false,
                            lineColor: 'rgb(100,100,100)'
                        }
                    }
                },
                states: {
                    hover: {
                        marker: {
                            enabled: false
                        }
                    }
                },
            }
        },
        tooltip: {
          formatter: function () {
          return '' + this.series.name + '
' + Highcharts.dateFormat('%Y-%m-%d', this.x) + '
' + Highcharts.dateFormat('%H:%M:%S', this.y); }, }, credits: false, exporting: false, legend: { itemStyle: { color: '#FFFF', fontWeight: 'bold' } }, title: false, series: this.state.chartState }

plotting: conditional formatting of function labels in a graph grid

I have a graphic panel where each graphic shows the same functions but with different values.

I want to tag them with LabeledHowever, since the label is quite spacious, it does not fit if I use a uniform place to place it.

Consider the following reduced example:

First, I create some data:

function1(x_) := u x^2
function2(x_) := v Sin(x)

fObs = Flatten(
   Table({function1(x), function2(x), u, v}, {u, {4, 5, 6}}, {v, { 1, 2, 3}}), 1);

and the plot:

Grid@Partition(Map(Show(

 Plot(Labeled(
   #((1)),
   "f1- first", {Scaled (2/3), Left}
    ), {x, 0, 1}, 
  PlotLabel -> 
   Style(("u= " <> ToString(#((3))) <> ", v=" <> 
      ToString(#((4)) ) ), Black)),

 Plot(Labeled(
   #((2)),
   "f2- second", {.9, Below}
    ), {x, 0, 1}

  )

 ) &, fObs)
           , 2)

The result is as follows: enter the description of the image here

As an example, I want to have the labels on the right for the first three rows and on the left for the next row.

Then I created Piecewise functions hoping to change the labeling of some values ​​in the grid. However the Labeled command of the Piecewise function, where the function is outside the relevant area still produces a label. It is placed on the axis (highlighted).

 Grid@Partition(Map(Show(

 Plot(Labeled(
   #((1)),
   "f1- first", {Scaled (2/3), Left}
    ), {x, 0, 1}, 
  PlotLabel -> 
   Style(("u= " <> ToString(#((3))) <> ", v=" <> 
      ToString(#((4)) ) ), Black)
  ),

 Plot(Labeled(Piecewise({{
      #((2)), #((3)) <= 5}, {-100, #((3)) > 5}}),
   "f2- second", {.1, Above}
    ), {x, 0, 1}
  ),
 Plot(Labeled(Piecewise({{
      #((2)), #((3)) > 5}, {-10, #((3)) > 5}}),
   "f2- second", {.9, Below}
    ), {x, 0, 1}
  )


 ) &, fObs)
   , 2)

enter the description of the image here

Is there a better clean way to create conditional tagging in that context?

query on Serre's definition of the Ihara zeta function of a finite graph

Serre defined the Ieta zeta function as a product of $ (1-u l (c)} – -1 for all cousin reduced cycles $ c $ of a finite graph. My question is: does each main cycle count twice for the two different orientations it has, or not?

plotting: graph a function in a given plane

I think that the general way to ask the question is as follows: how can I ask Mathematica to draw a function in a certain plane?

A simple example.

Let's assume a function given by
$$ begin {align}
begin {aligned}
X & = X_0 + X_1 + X_2 \
X_0 & = 3 tau \
X_1 & = cos (3 tau) cos (3 sigma) \
X_2 & = sin (3 tau) cos (3 sigma)
end {aligned}
end {align} $$

How can I trace the X function in the $ (X_1, X_2) $-plane?

plotting – How to graph a vertical isocline?

The r / a function is a vertical isocline. I need to find a way to graph it. At this time the line is not displayed, even when it is equal to and. I have experimented with Epilogue, but I am not familiar with it to incorporate it into the sequence plot.

———————— HERE IS MY CODE ———————- ————-

    Manipulate(
 Show(Plot({d/(f*a), r/a}, {x, 0, 100}, 
   PlotStyle -> {RandomChoice, Thick}, ImageSize -> Full, 
   PlotRange -> {{0, 100}, {0, 100}}), 
  StreamPlot({{(r*x - (a*x*y)), (f*a*x*y - d*y)}}, {x, 0, 100}, {y, 0,
     100}), AxesLabel -> {"N", "P"}, 
  LabelStyle -> Directive(Blue, Bold), ContentSize -> {100, 100}),

 {{r, 25}, 0, 100, Appearance -> "Labeled"},
 {{N, 50}, 0, 100, Appearance -> "Labeled"},
 {{a, .5}, 0, 1, Appearance -> "Labeled"},
 {{f, .5 }, 0, 1, Appearance -> "Labeled"},
 {{d, .5}, 0, 1, Appearance -> "Labeled"})

Algorithm to find the "middle center" of the unweighted graph

I have a large, unweighted, unweighted scattered graph (20M vertices, 60M edges) and I would like to find what I call the "middle center" (the vertex with the shortest average distance to all other vertices. Does this already have a name?) Be of a $ O (N ^ 2) $ solution: Starting at each vertex: BFS to calculate the average distance to all other vertices, choose the minimum. But $ N ^ 2 $ it's too slow for a graph of this size, is there any way to calculate the "middle center" faster than $ N ^ 2 $ time? Is there any good approach algorithm? Or more efficient algorithms that find some similar "center" of a graph?

algorithms: maximum flow in a tripartite graph

I have to solve an assignment problem between $ {1, points, N } $ agents and $ {1, points, M } $ objects, which comes to maximize:
begin {equation}
sum_ {ij} beta_ {ij} x_ {ij}
end {equation}

where $ x_ {ij} $ equals one if the object $ j $ is assigned to $ i $, $ 0 $ otherwise. The benefit of such assignment is the non-negative value $ beta_ {ij} $.

This problem usually comes with some restrictions:
begin {equation}
sum_i x_ {ij} = 1 ~, ~~ sum_j x_ {ij} = 1
end {equation}

indicating that an object can only be assigned once and that an agent can only assign an object.

As I understand it, this problem can also be seen as a maximum flow in a two-part chart and can be efficiently solved by an auction algorithm (see Bertsekas et al.)

I have to implement additional restrictions labeled $ k = 1, points, K $ which are all the same way: the $ k th one imposes that on a subset of objects $ mathcal {J} _k $, only a limited number of them, say $ P_k $, can be assigned at the same time:
begin {equation}
sum_ {j in mathcal {J} _k} sum_i x_ {ij} le P_k
end {equation}

My question is that I find it quite difficult to solve the previous problem with these new restrictions in a bipartite chart and I wonder if a tripartite chart would be more convenient.

Below is how you would do it. I would like to turn to people with more experience in this field to assess whether this approach is appropriate or if there is a simpler one.

I put the first problem with the additional restrictions in the form of a tripartite graph: the first column remains that of the agents and the third column that of the objects, except that the agents and the objects are no longer directly linked.

Between the first and the third column, I insert the column of $ {1, points, K } $ restrictions Leave $ y_ {ik} in {0,1 } $ be the link between the agent $ i $ and restriction $ k $. Additional restriction $ k $ now read:
begin {equation}
0 le sum_i y_ {ik} le P_k
end {equation}

The flow of agents over the restriction. $ k $ It is limited.

Also leave $ z_ {kj} in {0,1 } $ be the link between the constraint $ k $ and object $ j $.

That is, an object $ j $ can be linked to several restrictions, let's leave $ mathcal {K} _j $ be the subset of restrictions in which object $ j $ is involved, that is $ j in mathcal {J} _k $.

The restriction flow $ k $ The objects must be equal to that of the agents to this restriction:

begin {equation}
sum_i y_ {ik} = sum_j z_ {kj}
end {equation}

which means that an agent $ i $ is connected to the restriction $ k $ because there is some object $ j $ linked to him, and vice versa.

Then, returning to the bipartite chart, the link $ x_ {ij} $ between agent $ i $ and object $ j $ is now :
begin {equation}
x_ {ij} = sum_ {k in mathcal {K} _j} y_ {ik} + 1 – | mathcal {K} _j |
end {equation}

This equals only one if the agent $ i $ is connected to all restrictions $ k $ in what object $ j $ is involved. The downside is that $ x_ {ij} $ can be negative Another definition could be:
begin {equation}
x_ {ij} = min_ {k in mathcal {K} _j} {y_ {ik} }
end {equation}

but I would like to remain as linear as possible.

Why $ P_k <| mathcal {J} _k | $ there will always be at least $ | mathcal {J} _k | – P_k ​​$ unassigned objects due to restrictions $ k $.

Let's define a virtual agent $ s $ to which we attach all objects (with zero benefit) not linked to any restrictions $ k $, $ forall k ~~ z_ {kj} = 0 $. The link is denoted $ x_ {sj} in {0,1 } $ because it is a direct link between an agent and objects.

Each object $ j $ must comply:
begin {equation}
sum_ {k in mathcal {K} _j} z_ {kj} + mathcal {K} _j x_ {kj} = mathcal {K} _j
end {equation}

So any object $ j $ is connected to all its limitations, $ forall k in mathcal {K} _j ~, ~ z_ {kj} = 1 $or is connected to the virtual node, $ x_ {sj} = 1 $.

It is clear that if the flow in all restrictions reaches its maximum, it will be at least:
begin {equation}
sum_k (| mathcal {J} _k | -P_k)
end {equation}

unassigned objects, therefore:
begin {equation}
sum_j x_ {sj} ge sum_k (| mathcal {J} _k | -P_k)
end {equation}

Then, each time the links between an object and its restrictions are broken, the object remains unassigned, so that:
begin {equation}
sum_j x_ {sj} – sum_k (| mathcal {J} _k | -P_k) = sum_k y_ {sk}
end {equation}

where $ y_ {sk} $ is the link between the virtual agent and the constraint $ k $whose capacity is $ {0, points, P_k } $ and checks:
begin {equation}
sum_i y_ {ik} + y_ {sk} = P_k ~, ~~ 0 le y_ {sk} le P_k
end {equation}

Returning to the allocation problem, maximization becomes:
begin {equation}
begin {split}
sum_ {ij} beta_ {ij} x_ {ij} = & sum_ {ij} beta_ {ij} biggl ( sum_ {k in mathcal {K} _j} y_ {ik} + 1 – | mathcal {K} _j | biggr) \
= & sum_ {ik} biggl ( sum_ {j in mathcal {J} _k} beta_ {ij} biggr) and_ {ik} + sum_j (1 – | mathcal {K} _j |) sum_i beta_ {ij}
end {split}
end {equation}

so that maximization now takes place between agents and restrictions. So I would like to write the dual formulation of this problem to solve it with an auction algorithm: agents have to buy all the restrictions to which an object is related to be able to assign it.

complexity theory: maximum flat cut graph with restrictions

Given a flat graph G = (V, E)

I am looking for a maximum cut of something with the following conditions: are some vertices in one of the established partitions?

Is something still polynomial?

I mean that a selected subset of vertices must be in a set of partitions.

Color a graph with an odd number of vertices with colors $ k $ (which is close to $ Delta $) in linear time

We have a simple connected non-directed graph with an odd number of vertices. We also know the number $ k $ which is actually the nearest odd number greater than or equal to $ Delta $. (So ​​yes $ Delta $ even, $ k = Delta + 1 $ plus $ k = Delta $.) that is to say $ k $ It is the least odd number that is greater than or equal to the degrees of all vertices.

We want to find a linear time algorithm that colors the graph with $ k $ colors.

I am very new to graphic coloring algorithms. I know that a greedy algorithm is actually linear time and can color the graph with $ Delta + 1 $. But I can't guarantee that I can color it with $ k = Delta $ when $ Delta $ It is odd.
Also, we should probably use all the information the question gives us. that is, using an odd number of vertices in some way, but the greedy algorithm does not use this additional information.

How can i solve this?

plotting: Plot3D does not show the expected graph

I'm trying to Plot3D a complicated function, and I was getting an empty plot, nothing. Everything was well written. Then, I went to the definition and copied the first example there, maybe something was wrong on a more "fundamental" level.

I tried this

Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}]

which, according to 1, should give

3D plot

but in my case it was

my plot

Note that in the screenshot I wanted to show my version of Mathematica. Also, I should mention some details about my operating system, Ubuntu 18.04.3 LTS

enter the description of the image here

because I tried the same Plot3D on my laptop, with Windows10, and there was no problem. So, I guess the problem is with some configuration of my version or graphics. Any suggestion?