Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIN_ONEB semiring #76

Open
eriknw opened this issue Mar 29, 2023 · 4 comments
Open

MIN_ONEB semiring #76

eriknw opened this issue Mar 29, 2023 · 4 comments
Milestone

Comments

@eriknw
Copy link
Member

eriknw commented Mar 29, 2023

A common use case for the ANY monoid (see #21) is in the ANY_PAIR semiring that is currently in SuiteSparse:GraphBLAS. The PAIR operator is called ONEB in the C spec, and, mathematically, FIRST_ONEB MIN_ONEB is the same as ANY_ONEB. So, the simplest way to support most use cases for the ANY monoid is to add the FIRST_ONEB MIN_ONEB semiring to the C spec (possibly in 2.1).

@eriknw eriknw added this to the v2.1 milestone Mar 29, 2023
@DrTimothyAldenDavis
Copy link
Member

Using FIRST as a monoid would break GraphBLAS badly. MIN_ONEB would be better and has the same effect.

@eriknw
Copy link
Member Author

eriknw commented Mar 29, 2023

bwahaha, yes, my bad. MIN_ONEB

@eriknw eriknw changed the title FIRST_ONEB semiring MIN_ONEB semiring Mar 29, 2023
@DrTimothyAldenDavis
Copy link
Member

Internally, if I see a MIN_ONEB semiring (or many many other cases), I convert it into my ANY_PAIR_ISO semiring. That semiring is purely symbolic, and there are many semirings that map directly to it.

See https://github.com/DrTimothyAldenDavis/GraphBLAS/blob/stable/Source/GB_iso_AxB.c . For any GrB_mxm operation where I can tell that C is iso, I call my ANY_PAIR_ISO method, and compute the single iso value of C in GB_iso_AxB.c.

TIMES_PAIR_INT32 for example, does the same thing. C(i,j) = 1 in this case.

@DrTimothyAldenDavis
Copy link
Member

The one thing that ANY provides that MIN cannot, is its use in the BFS where I can get different results, non-deterministically, but where all results are acceptable. In this case, ANY is much faster than MIN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants