Wolfram Mathematica

Welcome! This is the main Mathematica chat room for mathematic...
Feb 15, 2018 09:26
@Alucard IMHO Macbooks are better then your run of the mill windows notebook even when you plan on running windows on it.
Jan 10, 2018 10:17
I mainly use StringTemplate because I like the syntax and never noticed this issue ...until I called it a few hundred thousand times in one go
Jan 10, 2018 10:16
@Kuba Thanks for confirming this
Jan 10, 2018 09:53
takes 0.0005ish seconds which does not sound too much but is reeeeeaaaallly slow compared to basic arithmetic
Jan 10, 2018 09:52
    StringTemplate["first `a` then `b`"][<|"a" -> 1234,
   "b" -> 5678|>] // AbsoluteTiming
Jan 10, 2018 09:51
Is it only me or is StringTemplate horribly slow? On my machine
Jan 8, 2018 09:21
@Szabolcs I also noticed that the syntax PropertyValue[{g, someEdge}, {edgeProp1, edgeProp2, ...}] does not evaluate. It is mentioned in the documentation as the third syntax variant (but no examples is given). Can you (or anyone else confirm this)?
Jan 8, 2018 08:13
@Szabolcs I reported my issue with Subgraph (together with the obligatory rage rant at the state of the graph functionality in Mathematica)
Jan 5, 2018 09:57
@Szabolcs No I have not reported my issues with Subgraph yet
Jan 4, 2018 07:41
Sanity check: Subgraph should not yield the complete graph g, shouldn't it?
g = CompleteGraph[10]
Subgraph[g, 1 <-> _]
Jan 3, 2018 06:07
I haven't tried all kinds of quirky edge cases but for my use case it works well and performance is fine
Jan 3, 2018 06:05
Jan 3, 2018 06:05
g // IGEdgeSelect[# === Green &, EdgeStyle ]
Jan 3, 2018 06:05
Jan 3, 2018 06:03
g = CompleteGraph[5,
  EdgeStyle -> {1 <-> 2 -> Green, 3 <-> 4 -> Green}]
Jan 3, 2018 06:03
Usage example:
Jan 3, 2018 06:02
    IGEdgeSelect[function_, property_][g_] :=
 With[{selection =
    EdgeList[
     g, _?(Function[edge,
        Not@function@PropertyValue[{g, edge}, property]])]},
  EdgeDelete[g, selection] ]
Jan 3, 2018 06:02
@Szabolcs I tinkered a bit with my idea for a utility function IGEdgeSelect and came up with the following straight forward implementation:
Jan 2, 2018 13:12
Similar to the build-in Subgraph
Jan 2, 2018 13:11
For generality it might be nice if the result of such a function would not be a list of the edges but a graph containing only the selected edges. One would then have to call EdgeList on the Graph to get just the list of course
Jan 2, 2018 13:08
or IGEdgeSelect[function, edgeProperty]
Jan 2, 2018 13:07
Syntax could be something like IGEdgeMap e.g. graph // IGEdgeCases[pattern, edgeProperty]
Jan 2, 2018 13:05
Or in this case rather a Cases-like function
Jan 2, 2018 13:05
@Szabolcs Concerning my issue from before, a Select-like utility function would be a nice replacement for using the second argument of EdgeList (and VertexList).
Jan 2, 2018 12:58
I general I'd like to see more work done on anything optimization related be it flow in graphs or better/faster optimizers for NMinimize
Jan 2, 2018 12:56
Exactly
Jan 2, 2018 12:53
(for large graphs)
Jan 2, 2018 12:53
When comparing the result of FindIndependentEdgeSet and equivalent formulation for FindMinimumCostFlow for weighted bipartide graphs at some point FindMinimumCostFlow does give a different result than FindIndependentEdgeSet
Jan 2, 2018 12:51
Not that you mention OptimimFlowData, i also recently encountered an issue with FindMinimumCostFlow
Jan 2, 2018 12:45
This could all be so easy if WRI would just rewrite Properties to use associations
Jan 2, 2018 12:43
I can imagine that would be usefull
Jan 2, 2018 12:43
you mean like Merge does for associations?
Jan 2, 2018 12:39
Despite your philosophy to not duplicate build-in functionality in IGraphM, have you though about a IGPropertyValue function that remedies at least the syntactic issues with PropertyValue?
Jan 2, 2018 12:37
I personally find PropertyValue a pain to use in general
Jan 2, 2018 12:35
This is again something that should be easy but isn't. I don't get why the Patterntest for EdgeList does not get passed a "self reference" i.e. {graph, edge} instead of just edge
Jan 2, 2018 12:33
@Szabolcs Does IGraphM offer any way to write `graph // EdgeList[#, _?(Function[edge,
PropertyValue[{#, edge}, "Selected"]])] &` in a more compact and intuitive way?
Nov 30, 2017 14:28
I mostly use IGraphM for its utility functions e.g IGEdgeMap and friends
Nov 30, 2017 14:27
@Szabolcs As far as I could test mathematica's build-in FindIndependentEdgeSet works reasonably well. FindMinimumCostFlow on the other hand is not very reliable.
Nov 30, 2017 14:14
In the above picture every blue line is a possible match between to samples, the line thickness indicates the goodness of the match and the color i.e. red which matches were selected
Nov 30, 2017 14:12
I use FindIndependentEdgeSet to find matches of produced samples that best fit together to reduce tolerances in a final product
Nov 30, 2017 14:11
Nov 30, 2017 14:10
@Szabolcs BTW if you are interested in what I am doing:
Nov 30, 2017 14:01
IGEdgeApply might not be the right name though since what I want is not to apply a function Apply[f]@ someProperty but rather f@someProperty
Nov 30, 2017 13:59
another example instead of Rescale would be (max-#)& where max is the largest weight.
Nov 30, 2017 13:57
that is exactly what I mean
Nov 30, 2017 13:57
Yes
Nov 30, 2017 13:55
@Szabolcs I have played around with IGraphM in the last week and I am very impressed! I hope you won't mind comments/feature requests from me in the future as I already have one: IGEdgeApply would be a useful function to have e.g. to use Rescale on the EdgeWeights as a whole.
Nov 16, 2017 11:01
Have you fiddeled with finding maximum maximal matchings?
Nov 16, 2017 11:00
I currently use FindIndependendEdgeSet and this seems to solve the problem but since the documentation is so thin here (and I am no expert on graphs) I doubt myself a bit.
Nov 16, 2017 10:59
I work with weighted, undirected adjacency graphs for solving a combinatorical problem (matching from a pool of individual samples by some distance metric).