Skip to content

Commit 8edc945

Browse files
committed
update docs
1 parent 6e86128 commit 8edc945

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

docs/src/performancetips.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ The `TropicalGEMM` pirates the `LinearAlgebra.mul!` interface, hence it takes ef
8888
The GEMM routine can speed up the computation on CPU for one order, with multi-threading, it can be even faster.
8989
Benchmark shows the performance of `TropicalGEMM` is close to the theoretical optimal value.
9090

91+
## Sum product representation for configurations
92+
[`TreeConfigEnumerator`](@ref) can save a lot memory for you to store exponential number of configurations in polynomial space.
93+
It is a sum-product expression tree to store [`ConfigEnumerator`](@ref) in a lazy style, configurations can be extracted by depth first searching the tree with the `Base.collect` method. Although it is space efficient, it is in general not easy to extract information from it.
94+
This tree structure supports directed sampling so that one can get some statistic properties from it with an intermediate effort.
95+
96+
(To be written.)
97+
9198
## Make use of GPUs
9299
To upload the computing to GPU, you just add need to use CUDA, and offer a new key word argument.
93100
```julia

examples/IndependentSet.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ loaded_sets = load_configs(filename; format=:binary, bitlength=10)
157157
# * [`ConfigsMin`](@ref) for enumerating minimum set size,
158158

159159

160-
# ## Weights and open vertices
160+
# ## Weighted Graphs
161161
# [`IndependentSet`](@ref) accepts weights as a key word argument.
162162
# The following code computes the weighted MIS problem.
163163
problem = IndependentSet(graph; weights=collect(1:10))
@@ -167,6 +167,13 @@ max_config_weighted = solve(problem, SingleConfigMax())[]
167167
show_graph(graph; locs=locations, vertex_colors=
168168
[iszero(max_config_weighted.c.data[i]) ? "white" : "red" for i=1:nv(graph)])
169169

170+
# For weighted MIS problem, a property that many people care about is the "energy spectrum", or the largest weights.
171+
# One just feed a positional argument in the [`SizeMax`](@ref) constructor as the number of largest weights.
172+
spectrum = solve(problem, SizeMax(10))
173+
174+
# It uses the [`ExtendedTropical`](@ref) as the tensor elements.
175+
176+
# ## Open vertices and MIS tensor analysis
170177
# The following code computes the MIS tropical tensor (reference to be added) with open vertices 1, 2 and 3.
171178
problem = IndependentSet(graph; openvertices=[1,2,3])
172179

src/arithematics.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ end
176176
Extended Tropical numbers with largest `K` orders keeped,
177177
or the [`TruncatedPoly`](@ref) without coefficients,
178178
`TO` is the element type of orders.
179+
This algebra maps
180+
181+
* `+` to finding largest `K` values of union of two sets.
182+
* `*` to finding largest `K` values of sum combination of two sets.
183+
* `0` to set [-Inf, -Inf, ..., -Inf, -Inf]
184+
* `1` to set [-Inf, -Inf, ..., -Inf, 0]
179185
180186
Example
181187
------------------------------

0 commit comments

Comments
 (0)